Skip to content

Commit e93e884

Browse files
committed
fs/dcache: Re-use value stored to dentry->d_flags instead of re-reading
jira LE-1907 Rebuild_History Non-Buildable kernel-5.14.0-427.40.1.el9_4 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 35adc28 commit e93e884

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
@@ -356,7 +356,7 @@ static inline void __d_clear_type_and_inode(struct dentry *dentry)
356356
flags &= ~(DCACHE_ENTRY_TYPE | DCACHE_FALLTHRU);
357357
WRITE_ONCE(dentry->d_flags, flags);
358358
dentry->d_inode = NULL;
359-
if (dentry->d_flags & DCACHE_LRU_LIST)
359+
if (flags & DCACHE_LRU_LIST)
360360
this_cpu_inc(nr_dentry_negative);
361361
}
362362

0 commit comments

Comments
 (0)