summaryrefslogtreecommitdiffstats
path: root/fs/fuse/dir.c
diff options
context:
space:
mode:
authorMiklos Szeredi2017-09-12 16:57:54 +0200
committerMiklos Szeredi2017-09-12 16:57:54 +0200
commit5b97eeacbd80a7bb60f2534eb43304f821e1ba06 (patch)
treeea23ede67dcf69958bc4f5a86974d5636bdecfce /fs/fuse/dir.c
parentfuse: honor iocb sync flags on write (diff)
downloadkernel-qcow2-linux-5b97eeacbd80a7bb60f2534eb43304f821e1ba06.tar.gz
kernel-qcow2-linux-5b97eeacbd80a7bb60f2534eb43304f821e1ba06.tar.xz
kernel-qcow2-linux-5b97eeacbd80a7bb60f2534eb43304f821e1ba06.zip
fuse: getattr cleanup
The refreshed argument isn't used by any caller, get rid of it. Use a helper for just updating the inode (no need to fill in a kstat). Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/fuse/dir.c')
-rw-r--r--fs/fuse/dir.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index 00800c07ba1c..622081b97426 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -923,33 +923,29 @@ static int fuse_do_getattr(struct inode *inode, struct kstat *stat,
return err;
}
-int fuse_update_attributes(struct inode *inode, struct kstat *stat,
- struct file *file, bool *refreshed)
+static int fuse_update_get_attr(struct inode *inode, struct file *file,
+ struct kstat *stat)
{
struct fuse_inode *fi = get_fuse_inode(inode);
- int err;
- bool r;
+ int err = 0;
if (time_before64(fi->i_time, get_jiffies_64())) {
- r = true;
forget_all_cached_acls(inode);
err = fuse_do_getattr(inode, stat, file);
- } else {
- r = false;
- err = 0;
- if (stat) {
- generic_fillattr(inode, stat);
- stat->mode = fi->orig_i_mode;
- stat->ino = fi->orig_ino;
- }
+ } else if (stat) {
+ generic_fillattr(inode, stat);
+ stat->mode = fi->orig_i_mode;
+ stat->ino = fi->orig_ino;
}
- if (refreshed != NULL)
- *refreshed = r;
-
return err;
}
+int fuse_update_attributes(struct inode *inode, struct file *file)
+{
+ return fuse_update_get_attr(inode, file, NULL);
+}
+
int fuse_reverse_inval_entry(struct super_block *sb, u64 parent_nodeid,
u64 child_nodeid, struct qstr *name)
{
@@ -1786,7 +1782,7 @@ static int fuse_getattr(const struct path *path, struct kstat *stat,
if (!fuse_allow_current_process(fc))
return -EACCES;
- return fuse_update_attributes(inode, stat, NULL, NULL);
+ return fuse_update_get_attr(inode, NULL, stat);
}
static const struct inode_operations fuse_dir_inode_operations = {