aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/super.c2
-rw-r--r--include/linux/shrinker.h1
2 files changed, 2 insertions, 1 deletions
diff --git a/fs/super.c b/fs/super.c
index 3f56a269a4f4..32a81f3467e0 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -61,7 +61,7 @@ static int prune_super(struct shrinker *shrink, struct shrink_control *sc)
61 return -1; 61 return -1;
62 62
63 if (!grab_super_passive(sb)) 63 if (!grab_super_passive(sb))
64 return -1; 64 return !sc->nr_to_scan ? 0 : -1;
65 65
66 if (sb->s_op && sb->s_op->nr_cached_objects) 66 if (sb->s_op && sb->s_op->nr_cached_objects)
67 fs_objects = sb->s_op->nr_cached_objects(sb); 67 fs_objects = sb->s_op->nr_cached_objects(sb);
diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h
index 790651b4e5ba..a83833a1f7a2 100644
--- a/include/linux/shrinker.h
+++ b/include/linux/shrinker.h
@@ -20,6 +20,7 @@ struct shrink_control {
20 * 'nr_to_scan' entries and attempt to free them up. It should return 20 * 'nr_to_scan' entries and attempt to free them up. It should return
21 * the number of objects which remain in the cache. If it returns -1, it means 21 * the number of objects which remain in the cache. If it returns -1, it means
22 * it cannot do any scanning at this time (eg. there is a risk of deadlock). 22 * it cannot do any scanning at this time (eg. there is a risk of deadlock).
23 * The callback must not return -1 if nr_to_scan is zero.
23 * 24 *
24 * The 'gfpmask' refers to the allocation we are currently trying to 25 * The 'gfpmask' refers to the allocation we are currently trying to
25 * fulfil. 26 * fulfil.