summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2023-10-30 13:57:12 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2023-11-25 02:33:41 -0500
commitcd9f84f35c2eaaf4da7e111021b604662326d8aa (patch)
tree2ebdabd15757c783b360add3391cd155309653c4 /fs
parent3fcf535626a44e107e2d536a2c43da0fb5bde121 (diff)
shrink_dentry_list(): no need to check that dentry refcount is marked dead
... we won't see DCACHE_MAY_FREE on anything that is *not* dead and checking d_flags is just as cheap as checking refcount. Reviewed-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/dcache.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/dcache.c b/fs/dcache.c
index bb862a304e1b..c1025921f8d3 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -1191,11 +1191,10 @@ void shrink_dentry_list(struct list_head *list)
spin_lock(&dentry->d_lock);
rcu_read_lock();
if (!shrink_lock_dentry(dentry)) {
- bool can_free = false;
+ bool can_free;
rcu_read_unlock();
d_shrink_del(dentry);
- if (dentry->d_lockref.count < 0)
- can_free = dentry->d_flags & DCACHE_MAY_FREE;
+ can_free = dentry->d_flags & DCACHE_MAY_FREE;
spin_unlock(&dentry->d_lock);
if (can_free)
dentry_free(dentry);