OSDN Git Service

afs: Keep track of invalid-before version for dentry coherency
authorDavid Howells <dhowells@redhat.com>
Fri, 6 Apr 2018 13:17:24 +0000 (14:17 +0100)
committerDavid Howells <dhowells@redhat.com>
Mon, 9 Apr 2018 20:53:59 +0000 (21:53 +0100)
commita4ff7401fbfa06fba3aac14db5b33c5b76298f2c
tree177712d205bb839152135e6bbeda92f23e4f0c85
parentdd9fbcb8e10349fbd640aaa5942455912004f284
afs: Keep track of invalid-before version for dentry coherency

Each afs dentry is tagged with the version that the parent directory was at
last time it was validated and, currently, if this differs, the directory
is scanned and the dentry is refreshed.

However, this leads to an excessive amount of revalidation on directories
that get modified on the client without conflict with another client.  We
know there's no conflict because the parent directory's data version number
got incremented by exactly 1 on any create, mkdir, unlink, etc., therefore
we can trust the current state of the unaffected dentries when we perform a
local directory modification.

Optimise by keeping track of the last version of the parent directory that
was changed outside of the client in the parent directory's vnode and using
that to validate the dentries rather than the current version.

Signed-off-by: David Howells <dhowells@redhat.com>
fs/afs/dir.c
fs/afs/fsclient.c
fs/afs/inode.c
fs/afs/internal.h