diff options
Diffstat (limited to 'fs/hugetlbfs/inode.c')
-rw-r--r-- | fs/hugetlbfs/inode.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 5b50a7a2225e..d1a78fc2a78e 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c | |||
@@ -665,11 +665,18 @@ static struct inode *hugetlbfs_alloc_inode(struct super_block *sb) | |||
665 | return &p->vfs_inode; | 665 | return &p->vfs_inode; |
666 | } | 666 | } |
667 | 667 | ||
668 | static void hugetlbfs_i_callback(struct rcu_head *head) | ||
669 | { | ||
670 | struct inode *inode = container_of(head, struct inode, i_rcu); | ||
671 | INIT_LIST_HEAD(&inode->i_dentry); | ||
672 | kmem_cache_free(hugetlbfs_inode_cachep, HUGETLBFS_I(inode)); | ||
673 | } | ||
674 | |||
668 | static void hugetlbfs_destroy_inode(struct inode *inode) | 675 | static void hugetlbfs_destroy_inode(struct inode *inode) |
669 | { | 676 | { |
670 | hugetlbfs_inc_free_inodes(HUGETLBFS_SB(inode->i_sb)); | 677 | hugetlbfs_inc_free_inodes(HUGETLBFS_SB(inode->i_sb)); |
671 | mpol_free_shared_policy(&HUGETLBFS_I(inode)->policy); | 678 | mpol_free_shared_policy(&HUGETLBFS_I(inode)->policy); |
672 | kmem_cache_free(hugetlbfs_inode_cachep, HUGETLBFS_I(inode)); | 679 | call_rcu(&inode->i_rcu, hugetlbfs_i_callback); |
673 | } | 680 | } |
674 | 681 | ||
675 | static const struct address_space_operations hugetlbfs_aops = { | 682 | static const struct address_space_operations hugetlbfs_aops = { |