vfs: add d_prune dentry operation
authorSage Weil <sage@newdream.net>
Fri, 28 Oct 2011 17:02:42 +0000 (10:02 -0700)
committerChristoph Hellwig <hch@serles.lst.de>
Wed, 2 Nov 2011 11:53:43 +0000 (12:53 +0100)
commitf0023bc617ba600956b9226f1806033d7486c8ba
tree7a5ad7481b160e1d40cdc95626bfdb5e8577c88e
parenta78ef704a8dd430225955f0709b22d4a6ba21deb
vfs: add d_prune dentry operation

This adds a d_prune dentry operation that is called by the VFS prior to
pruning (i.e. unhashing and killing) a hashed dentry from the dcache.
Wrap dentry_lru_del() and use the new _prune() helper in the cases where we
are about to unhash and kill the dentry.

This will be used by Ceph to maintain a flag indicating whether the
complete contents of a directory are contained in the dcache, allowing it
to satisfy lookups and readdir without addition server communication.

Renumber a few DCACHE_* #defines to group DCACHE_OP_PRUNE with the other
DCACHE_OP_ bits.

Signed-off-by: Sage Weil <sage@newdream.net>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Documentation/filesystems/Locking
fs/dcache.c
include/linux/dcache.h