Skip to content

Commit 837cf8e

Browse files
committed
fs/dcache: Re-use value stored to dentry->d_flags instead of re-reading
jira LE-3201 Rebuild_History Non-Buildable kernel-rt-4.18.0-553.22.1.rt7.363.el8_10 commit-author linke li <lilinke99@qq.com> commit 8bfb40b Currently, the __d_clear_type_and_inode() writes the value flags to dentry->d_flags, then immediately re-reads it in order to use it in a if statement. This re-read is useless because no other update to dentry->d_flags can occur at this point. This commit therefore re-use flags in the if statement instead of re-reading dentry->d_flags. Signed-off-by: linke li <lilinke99@qq.com> Link: https://lore.kernel.org/r/tencent_5E187BD0A61BA28605E85405F15228254D0A@qq.com Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Christian Brauner <brauner@kernel.org> (cherry picked from commit 8bfb40b) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent d56e517 commit 837cf8e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/dcache.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ static inline void __d_clear_type_and_inode(struct dentry *dentry)
327327
flags &= ~(DCACHE_ENTRY_TYPE | DCACHE_FALLTHRU);
328328
WRITE_ONCE(dentry->d_flags, flags);
329329
dentry->d_inode = NULL;
330-
if (dentry->d_flags & DCACHE_LRU_LIST)
330+
if (flags & DCACHE_LRU_LIST)
331331
this_cpu_inc(nr_dentry_negative);
332332
}
333333

0 commit comments

Comments
 (0)