aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Szeredi2021-10-22 17:03:01 +0200
committerMiklos Szeredi2021-10-22 17:03:01 +0200
commit371e8fd02969383204b1f6023451125dbc20dfbd (patch)
tree43cce9294d0ab65feafeb9287e3888ffd5dac85b
parentb5d9758297858288f1d8cd9b24a4e2f899f169e0 (diff)
fuse: move fuse_invalidate_attr() into fuse_update_ctime()
Logically it belongs there since attributes are invalidated due to the updated ctime. This is a cleanup and should not change behavior. Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
-rw-r--r--fs/fuse/dir.c9
-rw-r--r--fs/fuse/xattr.c10
2 files changed, 6 insertions, 13 deletions
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index 80a2181b402b..1b345ab48fd0 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -747,6 +747,7 @@ void fuse_flush_time_update(struct inode *inode)
void fuse_update_ctime(struct inode *inode)
{
+ fuse_invalidate_attr(inode);
if (!IS_NOCMTIME(inode)) {
inode->i_ctime = current_time(inode);
mark_inode_dirty_sync(inode);
@@ -784,7 +785,6 @@ static int fuse_unlink(struct inode *dir, struct dentry *entry)
if (inode->i_nlink > 0)
drop_nlink(inode);
spin_unlock(&fi->lock);
- fuse_invalidate_attr(inode);
fuse_dir_changed(dir);
fuse_invalidate_entry_cache(entry);
fuse_update_ctime(inode);
@@ -841,13 +841,10 @@ static int fuse_rename_common(struct inode *olddir, struct dentry *oldent,
err = fuse_simple_request(fm, &args);
if (!err) {
/* ctime changes */
- fuse_invalidate_attr(d_inode(oldent));
fuse_update_ctime(d_inode(oldent));
- if (flags & RENAME_EXCHANGE) {
- fuse_invalidate_attr(d_inode(newent));
+ if (flags & RENAME_EXCHANGE)
fuse_update_ctime(d_inode(newent));
- }
fuse_dir_changed(olddir);
if (olddir != newdir)
@@ -855,7 +852,6 @@ static int fuse_rename_common(struct inode *olddir, struct dentry *oldent,
/* newent will end up negative */
if (!(flags & RENAME_EXCHANGE) && d_really_is_positive(newent)) {
- fuse_invalidate_attr(d_inode(newent));
fuse_invalidate_entry_cache(newent);
fuse_update_ctime(d_inode(newent));
}
@@ -938,7 +934,6 @@ static int fuse_link(struct dentry *entry, struct inode *newdir,
if (likely(inode->i_nlink < UINT_MAX))
inc_nlink(inode);
spin_unlock(&fi->lock);
- fuse_invalidate_attr(inode);
fuse_update_ctime(inode);
} else if (err == -EINTR) {
fuse_invalidate_attr(inode);
diff --git a/fs/fuse/xattr.c b/fs/fuse/xattr.c
index 61dfaf7b7d20..0d3e7177fce0 100644
--- a/fs/fuse/xattr.c
+++ b/fs/fuse/xattr.c
@@ -42,10 +42,9 @@ int fuse_setxattr(struct inode *inode, const char *name, const void *value,
fm->fc->no_setxattr = 1;
err = -EOPNOTSUPP;
}
- if (!err) {
- fuse_invalidate_attr(inode);
+ if (!err)
fuse_update_ctime(inode);
- }
+
return err;
}
@@ -173,10 +172,9 @@ int fuse_removexattr(struct inode *inode, const char *name)
fm->fc->no_removexattr = 1;
err = -EOPNOTSUPP;
}
- if (!err) {
- fuse_invalidate_attr(inode);
+ if (!err)
fuse_update_ctime(inode);
- }
+
return err;
}