Skip to content

Commit cd9f84f

Browse files
author
Al Viro
committed
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>
1 parent 3fcf535 commit cd9f84f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

fs/dcache.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,11 +1191,10 @@ void shrink_dentry_list(struct list_head *list)
11911191
spin_lock(&dentry->d_lock);
11921192
rcu_read_lock();
11931193
if (!shrink_lock_dentry(dentry)) {
1194-
bool can_free = false;
1194+
bool can_free;
11951195
rcu_read_unlock();
11961196
d_shrink_del(dentry);
1197-
if (dentry->d_lockref.count < 0)
1198-
can_free = dentry->d_flags & DCACHE_MAY_FREE;
1197+
can_free = dentry->d_flags & DCACHE_MAY_FREE;
11991198
spin_unlock(&dentry->d_lock);
12001199
if (can_free)
12011200
dentry_free(dentry);

0 commit comments

Comments
 (0)