fs: icache RCU free inodes
[firefly-linux-kernel-4.4.55.git] / fs / udf / super.c
index 76f3d6d97b402ea14c391c46b8a924af9888cc6c..b539d53320fb45222681c5d025a13e664c98ff5f 100644 (file)
@@ -107,17 +107,16 @@ struct logicalVolIntegrityDescImpUse *udf_sb_lvidiu(struct udf_sb_info *sbi)
 }
 
 /* UDF filesystem type */
-static int udf_get_sb(struct file_system_type *fs_type,
-                     int flags, const char *dev_name, void *data,
-                     struct vfsmount *mnt)
+static struct dentry *udf_mount(struct file_system_type *fs_type,
+                     int flags, const char *dev_name, void *data)
 {
-       return get_sb_bdev(fs_type, flags, dev_name, data, udf_fill_super, mnt);
+       return mount_bdev(fs_type, flags, dev_name, data, udf_fill_super);
 }
 
 static struct file_system_type udf_fstype = {
        .owner          = THIS_MODULE,
        .name           = "udf",
-       .get_sb         = udf_get_sb,
+       .mount          = udf_mount,
        .kill_sb        = kill_block_super,
        .fs_flags       = FS_REQUIRES_DEV,
 };
@@ -140,11 +139,18 @@ static struct inode *udf_alloc_inode(struct super_block *sb)
        return &ei->vfs_inode;
 }
 
-static void udf_destroy_inode(struct inode *inode)
+static void udf_i_callback(struct rcu_head *head)
 {
+       struct inode *inode = container_of(head, struct inode, i_rcu);
+       INIT_LIST_HEAD(&inode->i_dentry);
        kmem_cache_free(udf_inode_cachep, UDF_I(inode));
 }
 
+static void udf_destroy_inode(struct inode *inode)
+{
+       call_rcu(&inode->i_rcu, udf_i_callback);
+}
+
 static void init_once(void *foo)
 {
        struct udf_inode_info *ei = (struct udf_inode_info *)foo;