]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/dcache.c
fs: convert inode and dentry shrinking to be node aware
[karo-tx-linux.git] / fs / dcache.c
index d74b5bdff7f959a1201a94e2d74ff09cf75c9db1..c932ed32c77b1b4cb80c5456b427c78d13d82e84 100644 (file)
@@ -937,6 +937,7 @@ 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
  *
  * 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
@@ -945,13 +946,14 @@ dentry_lru_isolate(struct list_head *item, spinlock_t *lru_lock, void *arg)
  * 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)
+long prune_dcache_sb(struct super_block *sb, unsigned long nr_to_scan,
+                    int nid)
 {
        LIST_HEAD(dispose);
        long freed;
 
-       freed = list_lru_walk(&sb->s_dentry_lru, dentry_lru_isolate,
-                             &dispose, nr_to_scan);
+       freed = list_lru_walk_node(&sb->s_dentry_lru, nid, dentry_lru_isolate,
+                                      &dispose, &nr_to_scan);
        shrink_dentry_list(&dispose);
        return freed;
 }