summaryrefslogtreecommitdiff
path: root/fs/fuse/inode.c
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2018-10-15 15:43:06 +0200
committerMiklos Szeredi <mszeredi@redhat.com>2018-10-15 15:43:06 +0200
commit2f1e81965fd0f672c3246e751385cdfe8f86bbee (patch)
tree9115e10dd34d90216c9ca9812e64d00fc6eb391b /fs/fuse/inode.c
parentedfa87281f4fa1b78a21f6db999935a2faa2f6b8 (diff)
fuse: allow fine grained attr cache invaldation
This patch adds the infrastructure for more fine grained attribute invalidation. Currently only 'atime' is invalidated separately. The use of this infrastructure is extended to the statx(2) interface, which for now means that if only 'atime' is invalid and STATX_ATIME is not specified in the mask argument, then no GETATTR request will be generated. Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/fuse/inode.c')
-rw-r--r--fs/fuse/inode.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index 8cebf4d5f51b..d5f845aefbc9 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -90,6 +90,7 @@ static struct inode *fuse_alloc_inode(struct super_block *sb)
fi = get_fuse_inode(inode);
fi->i_time = 0;
+ fi->inval_mask = 0;
fi->nodeid = 0;
fi->nlookup = 0;
fi->attr_version = 0;
@@ -164,6 +165,7 @@ void fuse_change_attributes_common(struct inode *inode, struct fuse_attr *attr,
fi->attr_version = ++fc->attr_version;
fi->i_time = attr_valid;
+ WRITE_ONCE(fi->inval_mask, 0);
inode->i_ino = fuse_squash_ino(attr->ino);
inode->i_mode = (inode->i_mode & S_IFMT) | (attr->mode & 07777);