1. 06 1月, 2009 7 次提交
    • J
      ocfs2: Use metadata-specific ocfs2_journal_access_*() functions. · 13723d00
      Joel Becker 提交于
      The per-metadata-type ocfs2_journal_access_*() functions hook up jbd2
      commit triggers and allow us to compute metadata ecc right before the
      buffers are written out.  This commit provides ecc for inodes, extent
      blocks, group descriptors, and quota blocks.  It is not safe to use
      extened attributes and metaecc at the same time yet.
      
      The ocfs2_extent_tree and ocfs2_path abstractions in alloc.c both hide
      the type of block at their root.  Before, it didn't matter, but now the
      root block must use the appropriate ocfs2_journal_access_*() function.
      To keep this abstract, the structures now have a pointer to the matching
      journal_access function and a wrapper call to call it.
      
      A few places use naked ocfs2_write_block() calls instead of adding the
      blocks to the journal.  We make sure to calculate their checksum and ecc
      before the write.
      
      Since we pass around the journal_access functions.  Let's typedef them
      in ocfs2.h.
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      13723d00
    • T
      ocfs2/quota: sparse fixes for quota · df32b334
      Tao Ma 提交于
      Fix 2 minor things in quota. They are both found by sparse check.
      1. an endian bug in ocfs2_local_quota_add_chunk.
      2. change olq_alloc_dquot to static.
      Signed-off-by: NTao Ma <tao.ma@oracle.com>
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      df32b334
    • J
      ocfs2: Fix build warnings (64-bit types vs long long) · 9a2f3866
      Jan Kara 提交于
      fs/ocfs2/quota_local.c: In function 'olq_set_dquot':
      fs/ocfs2/quota_local.c:844: warning: format '%lld' expects type 'long long int', but argument 7 has type '__le64'
      fs/ocfs2/quota_local.c:844: warning: format '%lld' expects type 'long long int', but argument 8 has type '__le64'
      fs/ocfs2/quota_local.c:844: warning: format '%lld' expects type 'long long int', but argument 7 has type '__le64'
      fs/ocfs2/quota_local.c:844: warning: format '%lld' expects type 'long long int', but argument 8 has type '__le64'
      fs/ocfs2/quota_local.c:844: warning: format '%lld' expects type 'long long int', but argument 7 has type '__le64'
      fs/ocfs2/quota_local.c:844: warning: format '%lld' expects type 'long long int', but argument 8 has type '__le64'
      fs/ocfs2/quota_global.c: In function '__ocfs2_sync_dquot':
      fs/ocfs2/quota_global.c:457: warning: format '%lld' expects type 'long long int', but argument 8 has type 's64'
      fs/ocfs2/quota_global.c:457: warning: format '%lld' expects type 'long long int', but argument 10 has type 's64'
      fs/ocfs2/quota_global.c:457: warning: format '%lld' expects type 'long long int', but argument 8 has type 's64'
      fs/ocfs2/quota_global.c:457: warning: format '%lld' expects type 'long long int', but argument 10 has type 's64'
      fs/ocfs2/quota_global.c:457: warning: format '%lld' expects type 'long long int', but argument 8 has type 's64'
      fs/ocfs2/quota_global.c:457: warning: format '%lld' expects type 'long long int', but argument 10 has type 's64'
      Signed-off-by: NJan Kara <jack@suse.cz>
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      9a2f3866
    • J
      ocfs2: Fix ocfs2_read_quota_block() error handling. · 85eb8b73
      Joel Becker 提交于
      ocfs2_bread() has become ocfs2_read_virt_blocks(), with a prototype to
      match ocfs2_read_blocks().  The quota code, converting from
      ocfs2_bread(), wraps the call to ocfs2_read_virt_blocks() in
      ocfs2_read_quota_block().  Unfortunately, the prototype of
      ocfs2_read_quota_block() matches the old prototype of ocfs2_bread().
      
      The problem is that ocfs2_bread() returned the buffer head, and callers
      assumed that a NULL pointer was indicative of error.  It wasn't.  This
      is why ocfs2_bread() took an int*err argument as well.
      
      The new prototype of ocfs2_read_virt_blocks() avoids this error handling
      confusion.  Let's change ocfs2_read_quota_block() to match.
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      Acked-by: NJan Kara <jack@suse.cz>
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      85eb8b73
    • J
      ocfs2: Implement quota recovery · 2205363d
      Jan Kara 提交于
      Implement functions for recovery after a crash. Functions just
      read local quota file and sync info to global quota file.
      Signed-off-by: NJan Kara <jack@suse.cz>
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      2205363d
    • M
      ocfs2: Periodic quota syncing · 171bf93c
      Mark Fasheh 提交于
      This patch creates a work queue for periodic syncing of locally cached quota
      information to the global quota files. We constantly queue a delayed work
      item, to get the periodic behavior.
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      Acked-by: NJan Kara <jack@suse.cz>
      171bf93c
    • J
      ocfs2: Implementation of local and global quota file handling · 9e33d69f
      Jan Kara 提交于
      For each quota type each node has local quota file. In this file it stores
      changes users have made to disk usage via this node. Once in a while this
      information is synced to global file (and thus with other nodes) so that
      limits enforcement at least aproximately works.
      
      Global quota files contain all the information about usage and limits. It's
      mostly handled by the generic VFS code (which implements a trie of structures
      inside a quota file). We only have to provide functions to convert structures
      from on-disk format to in-memory one. We also have to provide wrappers for
      various quota functions starting transactions and acquiring necessary cluster
      locks before the actual IO is really started.
      Signed-off-by: NJan Kara <jack@suse.cz>
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      9e33d69f