1. 04 3月, 2011 3 次提交
  2. 20 2月, 2011 1 次提交
  3. 13 1月, 2011 1 次提交
    • S
      ceph: add dir_layout to inode · 6c0f3af7
      Sage Weil 提交于
      Add a ceph_dir_layout to the inode, and calculate dentry hash values based
      on the parent directory's specified dir_hash function.  This is needed
      because the old default Linux dcache hash function is extremely week and
      leads to a poor distribution of files among dir fragments.
      Signed-off-by: NSage Weil <sage@newdream.net>
      6c0f3af7
  4. 07 1月, 2011 6 次提交
    • N
      fs: rcu-walk aware d_revalidate method · 34286d66
      Nick Piggin 提交于
      Require filesystems be aware of .d_revalidate being called in rcu-walk
      mode (nd->flags & LOOKUP_RCU). For now do a simple push down, returning
      -ECHILD from all implementations.
      Signed-off-by: NNick Piggin <npiggin@kernel.dk>
      34286d66
    • N
      fs: dcache reduce branches in lookup path · fb045adb
      Nick Piggin 提交于
      Reduce some branches and memory accesses in dcache lookup by adding dentry
      flags to indicate common d_ops are set, rather than having to check them.
      This saves a pointer memory access (dentry->d_op) in common path lookup
      situations, and saves another pointer load and branch in cases where we
      have d_op but not the particular operation.
      
      Patched with:
      
      git grep -E '[.>]([[:space:]])*d_op([[:space:]])*=' | xargs sed -e 's/\([^\t ]*\)->d_op = \(.*\);/d_set_d_op(\1, \2);/' -e 's/\([^\t ]*\)\.d_op = \(.*\);/d_set_d_op(\&\1, \2);/' -i
      Signed-off-by: NNick Piggin <npiggin@kernel.dk>
      fb045adb
    • N
      fs: dcache remove dcache_lock · b5c84bf6
      Nick Piggin 提交于
      dcache_lock no longer protects anything. remove it.
      Signed-off-by: NNick Piggin <npiggin@kernel.dk>
      b5c84bf6
    • N
      fs: dcache scale subdirs · 2fd6b7f5
      Nick Piggin 提交于
      Protect d_subdirs and d_child with d_lock, except in filesystems that aren't
      using dcache_lock for these anyway (eg. using i_mutex).
      
      Note: if we change the locking rule in future so that ->d_child protection is
      provided only with ->d_parent->d_lock, it may allow us to reduce some locking.
      But it would be an exception to an otherwise regular locking scheme, so we'd
      have to see some good results. Probably not worthwhile.
      Signed-off-by: NNick Piggin <npiggin@kernel.dk>
      2fd6b7f5
    • N
      fs: dcache scale d_unhashed · da502956
      Nick Piggin 提交于
      Protect d_unhashed(dentry) condition with d_lock. This means keeping
      DCACHE_UNHASHED bit in synch with hash manipulations.
      Signed-off-by: NNick Piggin <npiggin@kernel.dk>
      da502956
    • N
      fs: dcache scale dentry refcount · b7ab39f6
      Nick Piggin 提交于
      Make d_count non-atomic and protect it with d_lock. This allows us to ensure a
      0 refcount dentry remains 0 without dcache_lock. It is also fairly natural when
      we start protecting many other dentry members with d_lock.
      Signed-off-by: NNick Piggin <npiggin@kernel.dk>
      b7ab39f6
  5. 18 12月, 2010 1 次提交
  6. 02 12月, 2010 1 次提交
  7. 19 11月, 2010 1 次提交
  8. 12 11月, 2010 2 次提交
  9. 21 10月, 2010 3 次提交
    • S
      ceph: do not carry i_lock for readdir from dcache · efa4c120
      Sage Weil 提交于
      We were taking dcache_lock inside of i_lock, which introduces a dependency
      not found elsewhere in the kernel, complicationg the vfs locking
      scalability work.  Since we don't actually need it here anyway, remove
      it.
      
      We only need i_lock to test for the I_COMPLETE flag, so be careful to do
      so without dcache_lock held.
      Signed-off-by: NSage Weil <sage@newdream.net>
      efa4c120
    • S
      ceph: do not hide .snap in root directory · 4c32f5dd
      Sage Weil 提交于
      Snaps in the root directory are now supported by the MDS, and harmless on
      older versions.
      Signed-off-by: NSage Weil <sage@newdream.net>
      4c32f5dd
    • Y
      ceph: factor out libceph from Ceph file system · 3d14c5d2
      Yehuda Sadeh 提交于
      This factors out protocol and low-level storage parts of ceph into a
      separate libceph module living in net/ceph and include/linux/ceph.  This
      is mostly a matter of moving files around.  However, a few key pieces
      of the interface change as well:
      
       - ceph_client becomes ceph_fs_client and ceph_client, where the latter
         captures the mon and osd clients, and the fs_client gets the mds client
         and file system specific pieces.
       - Mount option parsing and debugfs setup is correspondingly broken into
         two pieces.
       - The mon client gets a generic handler callback for otherwise unknown
         messages (mds map, in this case).
       - The basic supported/required feature bits can be expanded (and are by
         ceph_fs_client).
      
      No functional change, aside from some subtle error handling cases that got
      cleaned up in the refactoring process.
      Signed-off-by: NSage Weil <sage@newdream.net>
      3d14c5d2
  10. 12 9月, 2010 1 次提交
    • S
      ceph: fix null pointer deref on anon root dentry release · ca04d9c3
      Sage Weil 提交于
      When we release a root dentry, particularly after a splice, the parent
      (actually our) inode was evaluating to NULL and was getting dereferenced
      by ceph_snap().  This is reproduced by something as simple as
      
       mount -t ceph monhost:/a/b mnt
       mount -t ceph monhost:/a mnt2
       ls mnt2
      
      A splice_dentry() would kill the old 'b' inode's root dentry, and we'd
      crash while releasing it.
      
      Fix by checking for both the ROOT and NULL cases explicitly.  We only need
      to invalidate the parent dir when we have a correct parent to invalidate.
      Signed-off-by: NSage Weil <sage@newdream.net>
      ca04d9c3
  11. 25 8月, 2010 1 次提交
  12. 04 8月, 2010 1 次提交
  13. 02 8月, 2010 1 次提交
  14. 24 7月, 2010 1 次提交
    • S
      ceph: fix d_release dop for snapdir, snapped dentries · 252af521
      Sage Weil 提交于
      We need to set the d_release dop for snapdir and snapped dentries so that
      the ceph_dentry_info struct gets released.  We also use the dcache to
      cache readdir results when possible, which only works if we know when
      dentries are dropped from the cache.  Since we don't use the dcache for
      readdir in the hidden snapdir, avoid that case in ceph_dentry_release.
      Signed-off-by: NSage Weil <sage@newdream.net>
      252af521
  15. 23 7月, 2010 1 次提交
  16. 30 5月, 2010 1 次提交
    • J
      fs/ceph: Use ERR_CAST · 7e34bc52
      Julia Lawall 提交于
      Use ERR_CAST(x) rather than ERR_PTR(PTR_ERR(x)).  The former makes more
      clear what is the purpose of the operation, which otherwise looks like a
      no-op.
      
      In the case of fs/ceph/inode.c, ERR_CAST is not needed, because the type of
      the returned value is the same as the type of the enclosing function.
      
      The semantic patch that makes this change is as follows:
      (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @@
      type T;
      T x;
      identifier f;
      @@
      
      T f (...) { <+...
      - ERR_PTR(PTR_ERR(x))
      + x
       ...+> }
      
      @@
      expression x;
      @@
      
      - ERR_PTR(PTR_ERR(x))
      + ERR_CAST(x)
      // </smpl>
      Signed-off-by: NJulia Lawall <julia@diku.dk>
      Signed-off-by: NSage Weil <sage@newdream.net>
      7e34bc52
  17. 28 5月, 2010 1 次提交
  18. 18 5月, 2010 6 次提交
  19. 04 5月, 2010 1 次提交
    • S
      ceph: clear dir complete, invalidate dentry on replayed rename · ea1409f9
      Sage Weil 提交于
      If a rename operation is resent to the MDS following an MDS restart, the
      client does not get a full reply (containing the resulting metadata) back.
      In that case, a ceph_rename() needs to compensate by doing anything useful
      that fill_inode() would have, like d_move().
      
      It also needs to invalidate the dentry (to workaround the vfs_rename_dir()
      bug) and clear the dir complete flag, just like fill_trace().
      Signed-off-by: NSage Weil <sage@newdream.net>
      ea1409f9
  20. 14 4月, 2010 1 次提交
  21. 13 4月, 2010 1 次提交
  22. 31 3月, 2010 1 次提交
    • S
      ceph: fix dentry rehashing on virtual .snap dir · 9358c6d4
      Sage Weil 提交于
      If a lookup fails on the magic .snap directory, we bind it to a magic
      snap directory inode in ceph_lookup_finish().  That code assumes the dentry
      is unhashed, but a recent server-side change started returning NULL leases
      on lookup failure, causing the .snap dentry to be hashed and NULL by
      ceph_fill_trace().
      
      This causes dentry hash chain corruption, or a dies when d_rehash()
      includes
      	BUG_ON(!d_unhashed(entry));
      
      So, avoid processing the NULL dentry lease if it the dentry matches the
      snapdir name in ceph_fill_trace().  That allows the lookup completion to
      properly bind it to the snapdir inode.  BUG there if dentry is hashed to
      be sure.
      Signed-off-by: NSage Weil <sage@newdream.net>
      9358c6d4
  23. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  24. 23 3月, 2010 1 次提交
  25. 24 12月, 2009 1 次提交