Commit 39f1d1ff authored by Chuck Lever's avatar Chuck Lever

NFSD: Refactor nfsd_file_lru_scan()

Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
parent 3bc6d347
...@@ -472,23 +472,6 @@ static void nfsd_file_gc_dispose_list(struct list_head *dispose) ...@@ -472,23 +472,6 @@ static void nfsd_file_gc_dispose_list(struct list_head *dispose)
nfsd_file_dispose_list_delayed(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 static void
nfsd_file_gc(void) nfsd_file_gc(void)
{ {
...@@ -515,7 +498,13 @@ nfsd_file_lru_count(struct shrinker *s, struct shrink_control *sc) ...@@ -515,7 +498,13 @@ nfsd_file_lru_count(struct shrinker *s, struct shrink_control *sc)
static unsigned long static unsigned long
nfsd_file_lru_scan(struct shrinker *s, struct shrink_control *sc) 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 = { static struct shrinker nfsd_file_shrinker = {
......
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