diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2023-10-31 04:07:34 +0300 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2023-11-25 10:34:13 +0300 |
commit | f5c8a8a4b6c90f2160de6b580fa672b4afc15061 (patch) | |
tree | e8b95c0fca4a32e54d71419821e0a0d91595d3aa /fs | |
parent | c2e5e29f3fdaff6f57795be068ce525c60954fd0 (diff) | |
download | linux-f5c8a8a4b6c90f2160de6b580fa672b4afc15061.tar.xz |
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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/dcache.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/fs/dcache.c b/fs/dcache.c index 704676bf06fd..f68fe7c863e0 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -1495,13 +1495,9 @@ static enum d_walk_ret select_collect(void *_data, struct dentry *dentry) if (dentry->d_flags & DCACHE_SHRINK_LIST) { data->found++; - } else { - if (dentry->d_flags & DCACHE_LRU_LIST) - d_lru_del(dentry); - if (!dentry->d_lockref.count) { - d_shrink_add(dentry, &data->dispose); - data->found++; - } + } else if (!dentry->d_lockref.count) { + to_shrink_list(dentry, &data->dispose); + data->found++; } /* * 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) if (data->start == dentry) 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(); data->victim = dentry; return D_WALK_QUIT; } - } else { - if (dentry->d_flags & DCACHE_LRU_LIST) - d_lru_del(dentry); - if (!dentry->d_lockref.count) - d_shrink_add(dentry, &data->dispose); + to_shrink_list(dentry, &data->dispose); } /* * We can return to the caller if we have found some (this |