Skip to content

Commit 371e8fd

Browse files
author
Miklos Szeredi
committed
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 <[email protected]>
1 parent b5d9758 commit 371e8fd

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

fs/fuse/dir.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -747,6 +747,7 @@ void fuse_flush_time_update(struct inode *inode)
747747

748748
void fuse_update_ctime(struct inode *inode)
749749
{
750+
fuse_invalidate_attr(inode);
750751
if (!IS_NOCMTIME(inode)) {
751752
inode->i_ctime = current_time(inode);
752753
mark_inode_dirty_sync(inode);
@@ -784,7 +785,6 @@ static int fuse_unlink(struct inode *dir, struct dentry *entry)
784785
if (inode->i_nlink > 0)
785786
drop_nlink(inode);
786787
spin_unlock(&fi->lock);
787-
fuse_invalidate_attr(inode);
788788
fuse_dir_changed(dir);
789789
fuse_invalidate_entry_cache(entry);
790790
fuse_update_ctime(inode);
@@ -841,21 +841,17 @@ static int fuse_rename_common(struct inode *olddir, struct dentry *oldent,
841841
err = fuse_simple_request(fm, &args);
842842
if (!err) {
843843
/* ctime changes */
844-
fuse_invalidate_attr(d_inode(oldent));
845844
fuse_update_ctime(d_inode(oldent));
846845

847-
if (flags & RENAME_EXCHANGE) {
848-
fuse_invalidate_attr(d_inode(newent));
846+
if (flags & RENAME_EXCHANGE)
849847
fuse_update_ctime(d_inode(newent));
850-
}
851848

852849
fuse_dir_changed(olddir);
853850
if (olddir != newdir)
854851
fuse_dir_changed(newdir);
855852

856853
/* newent will end up negative */
857854
if (!(flags & RENAME_EXCHANGE) && d_really_is_positive(newent)) {
858-
fuse_invalidate_attr(d_inode(newent));
859855
fuse_invalidate_entry_cache(newent);
860856
fuse_update_ctime(d_inode(newent));
861857
}
@@ -938,7 +934,6 @@ static int fuse_link(struct dentry *entry, struct inode *newdir,
938934
if (likely(inode->i_nlink < UINT_MAX))
939935
inc_nlink(inode);
940936
spin_unlock(&fi->lock);
941-
fuse_invalidate_attr(inode);
942937
fuse_update_ctime(inode);
943938
} else if (err == -EINTR) {
944939
fuse_invalidate_attr(inode);

fs/fuse/xattr.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,9 @@ int fuse_setxattr(struct inode *inode, const char *name, const void *value,
4242
fm->fc->no_setxattr = 1;
4343
err = -EOPNOTSUPP;
4444
}
45-
if (!err) {
46-
fuse_invalidate_attr(inode);
45+
if (!err)
4746
fuse_update_ctime(inode);
48-
}
47+
4948
return err;
5049
}
5150

@@ -173,10 +172,9 @@ int fuse_removexattr(struct inode *inode, const char *name)
173172
fm->fc->no_removexattr = 1;
174173
err = -EOPNOTSUPP;
175174
}
176-
if (!err) {
177-
fuse_invalidate_attr(inode);
175+
if (!err)
178176
fuse_update_ctime(inode);
179-
}
177+
180178
return err;
181179
}
182180

0 commit comments

Comments
 (0)