]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/inode.c
fs: consolidate {nr,free}_cached_objects args in shrink_control
[karo-tx-linux.git] / fs / inode.c
index aa149e7262acffff13db5707eeb0c0144add985c..524a32c2b0c6b795486418529871782dad55414d 100644 (file)
@@ -194,7 +194,7 @@ int inode_init_always(struct super_block *sb, struct inode *inode)
 #ifdef CONFIG_FSNOTIFY
        inode->i_fsnotify_mask = 0;
 #endif
-
+       inode->i_flctx = NULL;
        this_cpu_inc(nr_inodes);
 
        return 0;
@@ -237,6 +237,7 @@ void __destroy_inode(struct inode *inode)
        BUG_ON(inode_has_buffers(inode));
        security_inode_free(inode);
        fsnotify_inode_delete(inode);
+       locks_free_lock_context(inode->i_flctx);
        if (!inode->i_nlink) {
                WARN_ON(atomic_long_read(&inode->i_sb->s_remove_count) == 0);
                atomic_long_dec(&inode->i_sb->s_remove_count);
@@ -355,7 +356,6 @@ void address_space_init_once(struct address_space *mapping)
        INIT_LIST_HEAD(&mapping->private_list);
        spin_lock_init(&mapping->private_lock);
        mapping->i_mmap = RB_ROOT;
-       INIT_LIST_HEAD(&mapping->i_mmap_nonlinear);
 }
 EXPORT_SYMBOL(address_space_init_once);
 
@@ -751,14 +751,13 @@ inode_lru_isolate(struct list_head *item, spinlock_t *lru_lock, void *arg)
  * to trim from the LRU. Inodes to be freed are moved to a temporary list and
  * then are freed outside inode_lock by dispose_list().
  */
-long prune_icache_sb(struct super_block *sb, unsigned long nr_to_scan,
-                    int nid)
+long prune_icache_sb(struct super_block *sb, struct shrink_control *sc)
 {
        LIST_HEAD(freeable);
        long freed;
 
-       freed = list_lru_walk_node(&sb->s_inode_lru, nid, inode_lru_isolate,
-                                      &freeable, &nr_to_scan);
+       freed = list_lru_shrink_walk(&sb->s_inode_lru, sc,
+                                    inode_lru_isolate, &freeable);
        dispose_list(&freeable);
        return freed;
 }