]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - fs/xfs/xfs_iget.c
fs: icache RCU free inodes
[mirror_ubuntu-artful-kernel.git] / fs / xfs / xfs_iget.c
index 0cdd26932d8e8d1c22ac008b4d4d107c69187468..d7de5a3f78670c593116220e16fb24f18d14812f 100644 (file)
@@ -91,6 +91,17 @@ xfs_inode_alloc(
        return ip;
 }
 
+STATIC void
+xfs_inode_free_callback(
+       struct rcu_head         *head)
+{
+       struct inode            *inode = container_of(head, struct inode, i_rcu);
+       struct xfs_inode        *ip = XFS_I(inode);
+
+       INIT_LIST_HEAD(&inode->i_dentry);
+       kmem_zone_free(xfs_inode_zone, ip);
+}
+
 void
 xfs_inode_free(
        struct xfs_inode        *ip)
@@ -134,7 +145,7 @@ xfs_inode_free(
        ASSERT(!spin_is_locked(&ip->i_flags_lock));
        ASSERT(completion_done(&ip->i_flush));
 
-       kmem_zone_free(xfs_inode_zone, ip);
+       call_rcu(&ip->i_vnode.i_rcu, xfs_inode_free_callback);
 }
 
 /*