aboutsummaryrefslogtreecommitdiffstats
path: root/fs/afs/inode.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2018-04-06 14:17:24 +0100
committerDavid Howells <dhowells@redhat.com>2018-04-09 21:53:59 +0100
commita4ff7401fbfa06fba3aac14db5b33c5b76298f2c (patch)
tree177712d205bb839152135e6bbeda92f23e4f0c85 /fs/afs/inode.c
parentafs: Rearrange status mapping (diff)
downloadlinux-dev-a4ff7401fbfa06fba3aac14db5b33c5b76298f2c.tar.xz
linux-dev-a4ff7401fbfa06fba3aac14db5b33c5b76298f2c.zip
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>
Diffstat (limited to 'fs/afs/inode.c')
-rw-r--r--fs/afs/inode.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/afs/inode.c b/fs/afs/inode.c
index 2e32d475ec11..07f450513f3e 100644
--- a/fs/afs/inode.c
+++ b/fs/afs/inode.c
@@ -83,6 +83,7 @@ static int afs_inode_init_from_status(struct afs_vnode *vnode, struct key *key)
inode->i_blocks = 0;
inode->i_mapping->a_ops = &afs_fs_aops;
+ vnode->invalid_before = vnode->status.data_version;
read_sequnlock_excl(&vnode->cb_lock);