Commit f5c8a8a4 authored by Al Viro's avatar Al Viro

switch select_collect{,2}() to use of to_shrink_list()

Reviewed-by: default avatarChristian Brauner <brauner@kernel.org>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent c2e5e29f
...@@ -1495,13 +1495,9 @@ static enum d_walk_ret select_collect(void *_data, struct dentry *dentry) ...@@ -1495,13 +1495,9 @@ static enum d_walk_ret select_collect(void *_data, struct dentry *dentry)
if (dentry->d_flags & DCACHE_SHRINK_LIST) { if (dentry->d_flags & DCACHE_SHRINK_LIST) {
data->found++; data->found++;
} else { } else if (!dentry->d_lockref.count) {
if (dentry->d_flags & DCACHE_LRU_LIST) to_shrink_list(dentry, &data->dispose);
d_lru_del(dentry); data->found++;
if (!dentry->d_lockref.count) {
d_shrink_add(dentry, &data->dispose);
data->found++;
}
} }
/* /*
* We can return to the caller if we have found some (this * 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) ...@@ -1522,17 +1518,13 @@ static enum d_walk_ret select_collect2(void *_data, struct dentry *dentry)
if (data->start == dentry) if (data->start == dentry)
goto out; goto out;
if (dentry->d_flags & DCACHE_SHRINK_LIST) { if (!dentry->d_lockref.count) {
if (!dentry->d_lockref.count) { if (dentry->d_flags & DCACHE_SHRINK_LIST) {
rcu_read_lock(); rcu_read_lock();
data->victim = dentry; data->victim = dentry;
return D_WALK_QUIT; return D_WALK_QUIT;
} }
} else { to_shrink_list(dentry, &data->dispose);
if (dentry->d_flags & DCACHE_LRU_LIST)
d_lru_del(dentry);
if (!dentry->d_lockref.count)
d_shrink_add(dentry, &data->dispose);
} }
/* /*
* We can return to the caller if we have found some (this * We can return to the caller if we have found some (this
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment