]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/super.c
list_lru: dynamically adjust node arrays
[karo-tx-linux.git] / fs / super.c
index 181d42e2abff66d6a20fbfbe341723bc0858c57f..269d96857caa1dfc9bf41161d1e79ad074d06884 100644 (file)
@@ -195,8 +195,12 @@ static struct super_block *alloc_super(struct file_system_type *type, int flags)
                INIT_HLIST_NODE(&s->s_instances);
                INIT_HLIST_BL_HEAD(&s->s_anon);
                INIT_LIST_HEAD(&s->s_inodes);
-               list_lru_init(&s->s_dentry_lru);
-               list_lru_init(&s->s_inode_lru);
+
+               if (list_lru_init(&s->s_dentry_lru))
+                       goto err_out;
+               if (list_lru_init(&s->s_inode_lru))
+                       goto err_out_dentry_lru;
+
                INIT_LIST_HEAD(&s->s_mounts);
                init_rwsem(&s->s_umount);
                lockdep_set_class(&s->s_umount, &type->s_umount_key);
@@ -236,6 +240,9 @@ static struct super_block *alloc_super(struct file_system_type *type, int flags)
        }
 out:
        return s;
+
+err_out_dentry_lru:
+       list_lru_destroy(&s->s_dentry_lru);
 err_out:
        security_sb_free(s);
 #ifdef CONFIG_SMP