1. 24 4月, 2010 3 次提交
  2. 24 3月, 2010 1 次提交
  3. 05 3月, 2010 4 次提交
    • C
      dquot: cleanup dquot initialize routine · 871a2931
      Christoph Hellwig 提交于
      Get rid of the initialize dquot operation - it is now always called from
      the filesystem and if a filesystem really needs it's own (which none
      currently does) it can just call into it's own routine directly.
      
      Rename the now static low-level dquot_initialize helper to __dquot_initialize
      and vfs_dq_init to dquot_initialize to have a consistent namespace.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      871a2931
    • C
      dquot: move dquot initialization responsibility into the filesystem · 907f4554
      Christoph Hellwig 提交于
      Currently various places in the VFS call vfs_dq_init directly.  This means
      we tie the quota code into the VFS.  Get rid of that and make the
      filesystem responsible for the initialization.   For most metadata operations
      this is a straight forward move into the methods, but for truncate and
      open it's a bit more complicated.
      
      For truncate we currently only call vfs_dq_init for the sys_truncate case
      because open already takes care of it for ftruncate and open(O_TRUNC) - the
      new code causes an additional vfs_dq_init for those which is harmless.
      
      For open the initialization is moved from do_filp_open into the open method,
      which means it happens slightly earlier now, and only for regular files.
      The latter is fine because we don't need to initialize it for operations
      on special files, and we already do it as part of the namespace operations
      for directories.
      
      Add a dquot_file_open helper that filesystems that support generic quotas
      can use to fill in ->open.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      907f4554
    • C
      dquot: cleanup inode allocation / freeing routines · 63936dda
      Christoph Hellwig 提交于
      Get rid of the alloc_inode and free_inode dquot operations - they are
      always called from the filesystem and if a filesystem really needs
      their own (which none currently does) it can just call into it's
      own routine directly.
      
      Also get rid of the vfs_dq_alloc/vfs_dq_free wrappers and always
      call the lowlevel dquot_alloc_inode / dqout_free_inode routines
      directly, which now lose the number argument which is always 1.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      63936dda
    • C
      dquot: cleanup space allocation / freeing routines · 5dd4056d
      Christoph Hellwig 提交于
      Get rid of the alloc_space, free_space, reserve_space, claim_space and
      release_rsv dquot operations - they are always called from the filesystem
      and if a filesystem really needs their own (which none currently does)
      it can just call into it's own routine directly.
      
      Move shared logic into the common __dquot_alloc_space,
      dquot_claim_space_nodirty and __dquot_free_space low-level methods,
      and rationalize the wrappers around it to move as much as possible
      code into the common block for CONFIG_QUOTA vs not.  Also rename
      all these helpers to be named dquot_* instead of vfs_dq_*.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      5dd4056d
  4. 19 12月, 2009 2 次提交
    • T
      ocfs2: Set i_nlink properly during reflink. · 10cf1a02
      Tao Ma 提交于
      We create a file in orphan dir for reflink so that if there
      is any error, we don't create any wrong dentry in the dir.
      But actually the file in orphan dir should be i_nlink = 0
      so that it can be replayed and freed successfully.
      
      This patch first set i_nlink to 0 when creating the file in
      orphan dir and then set it to 1(reflink now only works for
      regular file) when we move it to the dest dir.
      Signed-off-by: NTao Ma <tao.ma@oracle.com>
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      10cf1a02
    • T
      ocfs2: Add reflinked file's inode to inode hash eariler. · c7d260af
      Tao Ma 提交于
      We used to add reflinked file's inode to inode hash when
      we add it to the dest dir. But actually there is a race.
      Consider the following sequence.
      1. reflink happens and create the inode in orphan dir.
      2. reflink thread is scheduled out because of some io.
      3. recovery begins to work and calls ocfs2_recover_orphans.
         It calls ocfs2_iget and get a new inode and i_count = 1.
         It calls iput then and delete inode. the buffer's
         uptodate state is cleared.
      
      This patch move insert_inode_hash to the create function so
      that it can be found by step 3 and prevented from deleting
      because i_count > 1.
      
      This resolves the bug
      http://oss.oracle.com/bugzilla/show_bug.cgi?id=1183.
      Signed-off-by: NTao Ma <tao.ma@oracle.com>
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      c7d260af
  5. 18 12月, 2009 1 次提交
  6. 23 9月, 2009 2 次提交
    • T
      ocfs2: Create reflinked file in orphan dir. · bc13d347
      Tao Ma 提交于
      reflink is a very complicated process, so it can't be integrated
      into one transaction. So if the system panic in the operation, we
      may leave a unfinished inode in the destication directory.
      
      So we will try to create an inode in orphan_dir first, reflink it
      to the src file and then move it to the destication file in the end.
      In that way we won't be afraid of any corruption during the reflink.
      
      This patch adds 2 functions for orphan_dir operation:
      1. Create a new inode in orphand dir.
      2. Move an inode to a target dir.
      
      Note:
      fsck.ocfs2 should work for us to remove the unfinished file in the
      orphan_dir.
      Signed-off-by: NTao Ma <tao.ma@oracle.com>
      bc13d347
    • T
      ocfs2: Use proper parameter for some inode operation. · 19bd341f
      Tao Ma 提交于
      In order to make the original function more suitable for reflink,
      we modify the following inode operations. Both are tiny.
      
      1. ocfs2_mknod_locked only use dentry for mlog, so move it to
         the caller so that reflink can use it without dentry.
      2. ocfs2_prepare_orphan_dir only want inode to get its ip_blkno.
         So use ip_blkno instead.
      Signed-off-by: NTao Ma <tao.ma@oracle.com>
      19bd341f
  7. 05 9月, 2009 2 次提交
  8. 23 6月, 2009 1 次提交
  9. 30 4月, 2009 1 次提交
  10. 04 4月, 2009 6 次提交
  11. 13 3月, 2009 1 次提交
  12. 06 1月, 2009 6 次提交
    • 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
    • J
      ocfs2: Add quota calls for allocation and freeing of inodes and space · a90714c1
      Jan Kara 提交于
      Add quota calls for allocation and freeing of inodes and space, also update
      estimates on number of needed credits for a transaction. Move out inode
      allocation from ocfs2_mknod_locked() because vfs_dq_init() must be called
      outside of a transaction.
      Signed-off-by: NJan Kara <jack@suse.cz>
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      a90714c1
    • J
      ocfs2: Wrap inode block reads in a dedicated function. · b657c95c
      Joel Becker 提交于
      The ocfs2 code currently reads inodes off disk with a simple
      ocfs2_read_block() call.  Each place that does this has a different set
      of sanity checks it performs.  Some check only the signature.  A couple
      validate the block number (the block read vs di->i_blkno).  A couple
      others check for VALID_FL.  Only one place validates i_fs_generation.  A
      couple check nothing.  Even when an error is found, they don't all do
      the same thing.
      
      We wrap inode reading into ocfs2_read_inode_block().  This will validate
      all the above fields, going readonly if they are invalid (they never
      should be).  ocfs2_read_inode_block_full() is provided for the places
      that want to pass read_block flags.  Every caller is passing a struct
      inode with a valid ip_blkno, so we don't need a separate blkno argument
      either.
      
      We will remove the validation checks from the rest of the code in a
      later commit, as they are no longer necessary.
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      b657c95c
    • T
      ocfs2: add ocfs2_init_acl in mknod · 89c38bd0
      Tiger Yang 提交于
      We need to get the parent directories acls and let the new child inherit it.
      To this, we add additional calculations for data/metadata allocation.
      Signed-off-by: NTiger Yang <tiger.yang@oracle.com>
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      89c38bd0
    • T
      ocfs2: add ocfs2_init_security in during file create · 534eaddd
      Tiger Yang 提交于
      Security attributes must be set when creating a new inode.
      
      We do this in three steps.
      
      - First, get security xattr's name and value by security_operation
      
      - Calculate and reserve the meta data and clusters needed by this security
        xattr before starting transaction
      
      - Finally, we set it before add_entry
      Signed-off-by: NTiger Yang <tiger.yang@oracle.com>
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      534eaddd
    • T
      ocfs2: move new inode allocation out of the transaction · f5d36202
      Tiger Yang 提交于
      Move out inode allocation from ocfs2_mknod_locked() because
      vfs_dq_init() must be called outside of a transaction.
      Signed-off-by: NJan Kara <jack@suse.cz>
      Signed-off-by: NTiger Yang <tiger.yang@oracle.com>
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      f5d36202
  13. 14 11月, 2008 1 次提交
  14. 11 11月, 2008 2 次提交
  15. 15 10月, 2008 2 次提交
  16. 14 10月, 2008 3 次提交
  17. 18 4月, 2008 2 次提交