]> git.baikalelectronics.ru Git - kernel.git/commit
[PATCH] Optimise d_find_alias()
authorDavid Howells <dhowells@redhat.com>
Sat, 25 Mar 2006 11:06:36 +0000 (03:06 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Sat, 25 Mar 2006 16:22:49 +0000 (08:22 -0800)
commitd5fcb1259e9edfe20b5011bd79ad6a416dfe227b
tree4cf0a18632cc663fcd75a1e23e357ec39c0c3b37
parenta4d807c56af254e54e0bc81e99ac5dcbdd3ab595
[PATCH] Optimise d_find_alias()

The attached patch optimises d_find_alias() to only take the spinlock if
there's anything in the the inode's alias list.  If there isn't, it returns
NULL immediately.

With respect to the superblock sharing patch, this should reduce by one the
number of times the dcache_lock is taken by nfs_lookup() for ordinary
directory lookups.

Only in the case where there's already a dentry for particular directory inode
(such as might happen when another mountpoint is rooted at that dentry) will
the lock then be taken the extra time.

Signed-off-by: David Howells <dhowells@redhat.com>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/dcache.c