Skip to content

Commit 09ecf8f

Browse files
Zizhi Wobrauner
authored andcommitted
cachefiles: Clean up in cachefiles_commit_tmpfile()
Currently, cachefiles_commit_tmpfile() will only be called if object->flags is set to CACHEFILES_OBJECT_USING_TMPFILE. Only cachefiles_create_file() and cachefiles_invalidate_cookie() set this flag. Both of these functions replace object->file with the new tmpfile, and both are called by fscache_cookie_state_machine(), so there are no concurrency issues. So the equation "d_backing_inode(dentry) == file_inode(object->file)" in cachefiles_commit_tmpfile() will never hold true according to the above conditions. This patch removes this part of the redundant code and does not involve any other logical changes. Signed-off-by: Zizhi Wo <[email protected]> Link: https://lore.kernel.org/r/[email protected] Acked-by: David Howells <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
1 parent 56f4856 commit 09ecf8f

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

fs/cachefiles/namei.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -691,11 +691,6 @@ bool cachefiles_commit_tmpfile(struct cachefiles_cache *cache,
691691
}
692692

693693
if (!d_is_negative(dentry)) {
694-
if (d_backing_inode(dentry) == file_inode(object->file)) {
695-
success = true;
696-
goto out_dput;
697-
}
698-
699694
ret = cachefiles_unlink(volume->cache, object, fan, dentry,
700695
FSCACHE_OBJECT_IS_STALE);
701696
if (ret < 0)

0 commit comments

Comments
 (0)