diff options
Diffstat (limited to 'fs/hugetlbfs')
-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 a5fe68189eed..9885082b470f 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c | |||
@@ -663,11 +663,18 @@ static struct inode *hugetlbfs_alloc_inode(struct super_block *sb) | |||
663 | return &p->vfs_inode; | 663 | return &p->vfs_inode; |
664 | } | 664 | } |
665 | 665 | ||
666 | static void hugetlbfs_i_callback(struct rcu_head *head) | ||
667 | { | ||
668 | struct inode *inode = container_of(head, struct inode, i_rcu); | ||
669 | INIT_LIST_HEAD(&inode->i_dentry); | ||
670 | kmem_cache_free(hugetlbfs_inode_cachep, HUGETLBFS_I(inode)); | ||
671 | } | ||
672 | |||
666 | static void hugetlbfs_destroy_inode(struct inode *inode) | 673 | static void hugetlbfs_destroy_inode(struct inode *inode) |
667 | { | 674 | { |
668 | hugetlbfs_inc_free_inodes(HUGETLBFS_SB(inode->i_sb)); | 675 | hugetlbfs_inc_free_inodes(HUGETLBFS_SB(inode->i_sb)); |
669 | mpol_free_shared_policy(&HUGETLBFS_I(inode)->policy); | 676 | mpol_free_shared_policy(&HUGETLBFS_I(inode)->policy); |
670 | kmem_cache_free(hugetlbfs_inode_cachep, HUGETLBFS_I(inode)); | 677 | call_rcu(&inode->i_rcu, hugetlbfs_i_callback); |
671 | } | 678 | } |
672 | 679 | ||
673 | static const struct address_space_operations hugetlbfs_aops = { | 680 | static const struct address_space_operations hugetlbfs_aops = { |