fs: icache RCU free inodes
[firefly-linux-kernel-4.4.55.git] / fs / hostfs / hostfs_kern.c
index 39dc505ed27310d651fdb924ef7e4b9d80609736..861113fcfc88ca3b366254a5adf1c7b1859a57fb 100644 (file)
@@ -247,11 +247,18 @@ static void hostfs_evict_inode(struct inode *inode)
        }
 }
 
-static void hostfs_destroy_inode(struct inode *inode)
+static void hostfs_i_callback(struct rcu_head *head)
 {
+       struct inode *inode = container_of(head, struct inode, i_rcu);
+       INIT_LIST_HEAD(&inode->i_dentry);
        kfree(HOSTFS_I(inode));
 }
 
+static void hostfs_destroy_inode(struct inode *inode)
+{
+       call_rcu(&inode->i_rcu, hostfs_i_callback);
+}
+
 static int hostfs_show_options(struct seq_file *seq, struct vfsmount *vfs)
 {
        const char *root_path = vfs->mnt_sb->s_fs_info;