]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/dcache.c
fs: consolidate {nr,free}_cached_objects args in shrink_control
[karo-tx-linux.git] / fs / dcache.c
index e368d4f412f97ed11039e3329c77358b3fc1fea0..56c5da89f58afd82d95272d025bf5982222cfec0 100644 (file)
@@ -930,24 +930,22 @@ dentry_lru_isolate(struct list_head *item, spinlock_t *lru_lock, void *arg)
 /**
  * prune_dcache_sb - shrink the dcache
  * @sb: superblock
- * @nr_to_scan : number of entries to try to free
- * @nid: which node to scan for freeable entities
+ * @sc: shrink control, passed to list_lru_shrink_walk()
  *
- * Attempt to shrink the superblock dcache LRU by @nr_to_scan entries. This is
- * done when we need more memory an called from the superblock shrinker
+ * Attempt to shrink the superblock dcache LRU by @sc->nr_to_scan entries. This
+ * is done when we need more memory and called from the superblock shrinker
  * function.
  *
  * This function may fail to free any resources if all the dentries are in
  * use.
  */
-long prune_dcache_sb(struct super_block *sb, unsigned long nr_to_scan,
-                    int nid)
+long prune_dcache_sb(struct super_block *sb, struct shrink_control *sc)
 {
        LIST_HEAD(dispose);
        long freed;
 
-       freed = list_lru_walk_node(&sb->s_dentry_lru, nid, dentry_lru_isolate,
-                                      &dispose, &nr_to_scan);
+       freed = list_lru_shrink_walk(&sb->s_dentry_lru, sc,
+                                    dentry_lru_isolate, &dispose);
        shrink_dentry_list(&dispose);
        return freed;
 }