Skip to content

Commit f5c8a8a

Browse files
author
Al Viro
committed
switch select_collect{,2}() to use of to_shrink_list()
Reviewed-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent c2e5e29 commit f5c8a8a

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

fs/dcache.c

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1495,13 +1495,9 @@ static enum d_walk_ret select_collect(void *_data, struct dentry *dentry)
14951495

14961496
if (dentry->d_flags & DCACHE_SHRINK_LIST) {
14971497
data->found++;
1498-
} else {
1499-
if (dentry->d_flags & DCACHE_LRU_LIST)
1500-
d_lru_del(dentry);
1501-
if (!dentry->d_lockref.count) {
1502-
d_shrink_add(dentry, &data->dispose);
1503-
data->found++;
1504-
}
1498+
} else if (!dentry->d_lockref.count) {
1499+
to_shrink_list(dentry, &data->dispose);
1500+
data->found++;
15051501
}
15061502
/*
15071503
* We can return to the caller if we have found some (this
@@ -1522,17 +1518,13 @@ static enum d_walk_ret select_collect2(void *_data, struct dentry *dentry)
15221518
if (data->start == dentry)
15231519
goto out;
15241520

1525-
if (dentry->d_flags & DCACHE_SHRINK_LIST) {
1526-
if (!dentry->d_lockref.count) {
1521+
if (!dentry->d_lockref.count) {
1522+
if (dentry->d_flags & DCACHE_SHRINK_LIST) {
15271523
rcu_read_lock();
15281524
data->victim = dentry;
15291525
return D_WALK_QUIT;
15301526
}
1531-
} else {
1532-
if (dentry->d_flags & DCACHE_LRU_LIST)
1533-
d_lru_del(dentry);
1534-
if (!dentry->d_lockref.count)
1535-
d_shrink_add(dentry, &data->dispose);
1527+
to_shrink_list(dentry, &data->dispose);
15361528
}
15371529
/*
15381530
* We can return to the caller if we have found some (this

0 commit comments

Comments
 (0)