diff options
author | Zizhi Wo <wozizhi@huawei.com> | 2024-11-07 19:06:47 +0800 |
---|---|---|
committer | Christian Brauner <brauner@kernel.org> | 2024-11-11 14:39:38 +0100 |
commit | 09ecf8f5505465b5527a39dff4b159af62306eee (patch) | |
tree | 1488750fa31527c2bd65d5f36dd8fdeb6c73782e | |
parent | 56f4856b425a30e1d8b3e41e6cde8bfba90ba5f8 (diff) | |
download | lwn-09ecf8f5505465b5527a39dff4b159af62306eee.tar.gz lwn-09ecf8f5505465b5527a39dff4b159af62306eee.zip |
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 <wozizhi@huawei.com>
Link: https://lore.kernel.org/r/20241107110649.3980193-4-wozizhi@huawei.com
Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
-rw-r--r-- | fs/cachefiles/namei.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/fs/cachefiles/namei.c b/fs/cachefiles/namei.c index 2b3f9935dbb4..7cf59713f0f7 100644 --- a/fs/cachefiles/namei.c +++ b/fs/cachefiles/namei.c @@ -691,11 +691,6 @@ bool cachefiles_commit_tmpfile(struct cachefiles_cache *cache, } if (!d_is_negative(dentry)) { - if (d_backing_inode(dentry) == file_inode(object->file)) { - success = true; - goto out_dput; - } - ret = cachefiles_unlink(volume->cache, object, fan, dentry, FSCACHE_OBJECT_IS_STALE); if (ret < 0) |