summaryrefslogtreecommitdiffstats
path: root/fs/fuse/fuse_i.h
diff options
context:
space:
mode:
authorMiklos Szeredi2018-10-01 10:07:04 +0200
committerMiklos Szeredi2018-10-01 10:07:04 +0200
commit3494927e090bf511e54eecaf33a8e56e5c0463db (patch)
tree0015407dc519f878d5dfc5233cfb1dc50e7ff7bd /fs/fuse/fuse_i.h
parentfuse: allow using readdir cache (diff)
downloadkernel-qcow2-linux-3494927e090bf511e54eecaf33a8e56e5c0463db.tar.gz
kernel-qcow2-linux-3494927e090bf511e54eecaf33a8e56e5c0463db.tar.xz
kernel-qcow2-linux-3494927e090bf511e54eecaf33a8e56e5c0463db.zip
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/fuse_i.h')
-rw-r--r--fs/fuse/fuse_i.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h
index 49e42635e3ac..8b24805e62ee 100644
--- a/fs/fuse/fuse_i.h
+++ b/fs/fuse/fuse_i.h
@@ -114,6 +114,9 @@ struct fuse_inode {
/* position at end of cache (position of next entry) */
loff_t pos;
+ /* version of the cache */
+ u64 version;
+
/* protects above fields */
spinlock_t lock;
} rdc;
@@ -176,6 +179,10 @@ struct fuse_file {
/* Offset in cache */
loff_t cache_off;
+
+ /* Version of cache we are reading */
+ u64 version;
+
} readdir;
/** RB node to be linked on fuse_conn->polled_files */