summaryrefslogtreecommitdiff
path: root/fs/fuse/inode.c
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2018-10-01 10:07:04 +0200
committerMiklos Szeredi <mszeredi@redhat.com>2018-10-01 10:07:04 +0200
commit3494927e090bf511e54eecaf33a8e56e5c0463db (patch)
tree0015407dc519f878d5dfc5233cfb1dc50e7ff7bd /fs/fuse/inode.c
parent5d7bc7e8680c7ca4c8a4f139ce2a54ccb8131ef0 (diff)
fuse: add readdir cache version
Allow the cache to be invalidated when page(s) have gone missing. In this case increment the version of the cache and reset to an empty state. Add a version number to the directory stream in struct fuse_file as well, indicating the version of the cache it's supposed to be reading. If the cache version doesn't match the stream's version, then reset the stream to the beginning of the cache. Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/fuse/inode.c')
-rw-r--r--fs/fuse/inode.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index 892efe6351eb..eef2ae713f75 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -104,6 +104,7 @@ static struct inode *fuse_alloc_inode(struct super_block *sb)
fi->rdc.cached = false;
fi->rdc.size = 0;
fi->rdc.pos = 0;
+ fi->rdc.version = 0;
mutex_init(&fi->mutex);
fi->forget = fuse_alloc_forget();
if (!fi->forget) {