]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - fs/afs/super.c
fs: icache RCU free inodes
[mirror_ubuntu-bionic-kernel.git] / fs / afs / super.c
index 27201cffece4946879f01482f7aa61ffdbc6b339..f901a9d7c111073c0e8efc1a598cb9b59f90f6ec 100644 (file)
@@ -498,6 +498,14 @@ static struct inode *afs_alloc_inode(struct super_block *sb)
        return &vnode->vfs_inode;
 }
 
+static void afs_i_callback(struct rcu_head *head)
+{
+       struct inode *inode = container_of(head, struct inode, i_rcu);
+       struct afs_vnode *vnode = AFS_FS_I(inode);
+       INIT_LIST_HEAD(&inode->i_dentry);
+       kmem_cache_free(afs_inode_cachep, vnode);
+}
+
 /*
  * destroy an AFS inode struct
  */
@@ -511,7 +519,7 @@ static void afs_destroy_inode(struct inode *inode)
 
        ASSERTCMP(vnode->server, ==, NULL);
 
-       kmem_cache_free(afs_inode_cachep, vnode);
+       call_rcu(&inode->i_rcu, afs_i_callback);
        atomic_dec(&afs_count_active_inodes);
 }