aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2022-07-08 14:24:31 -0400
committerChuck Lever <chuck.lever@oracle.com>2022-07-29 20:09:55 -0400
commit39f1d1ff8148902c5692ffb0e1c4479416ab44a7 (patch)
tree5c4b8a437b5c8264e2dc1a36cec9456700acaf5d /fs
parent3bc6d3470fe412f818f9bff6b71d1be3a76af8f3 (diff)
downloadlinux-39f1d1ff8148902c5692ffb0e1c4479416ab44a7.tar.gz
NFSD: Refactor nfsd_file_lru_scan()
Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfsd/filecache.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c
index f5e9d9f72d5d..029fb4cfa224 100644
--- a/fs/nfsd/filecache.c
+++ b/fs/nfsd/filecache.c
@@ -472,23 +472,6 @@ static void nfsd_file_gc_dispose_list(struct list_head *dispose)
nfsd_file_dispose_list_delayed(dispose);
}
-static unsigned long
-nfsd_file_lru_walk_list(struct shrink_control *sc)
-{
- LIST_HEAD(head);
- unsigned long ret;
-
- if (sc)
- ret = list_lru_shrink_walk(&nfsd_file_lru, sc,
- nfsd_file_lru_cb, &head);
- else
- ret = list_lru_walk(&nfsd_file_lru,
- nfsd_file_lru_cb,
- &head, LONG_MAX);
- nfsd_file_gc_dispose_list(&head);
- return ret;
-}
-
static void
nfsd_file_gc(void)
{
@@ -515,7 +498,13 @@ nfsd_file_lru_count(struct shrinker *s, struct shrink_control *sc)
static unsigned long
nfsd_file_lru_scan(struct shrinker *s, struct shrink_control *sc)
{
- return nfsd_file_lru_walk_list(sc);
+ LIST_HEAD(dispose);
+ unsigned long ret;
+
+ ret = list_lru_shrink_walk(&nfsd_file_lru, sc,
+ nfsd_file_lru_cb, &dispose);
+ nfsd_file_gc_dispose_list(&dispose);
+ return ret;
}
static struct shrinker nfsd_file_shrinker = {