Skip to content

Commit 74b1da5

Browse files
author
Al Viro
committed
shmem: make use of ->free_inode()
same situation as for hugetlbfs Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent b62de32 commit 74b1da5

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

‎mm/shmem.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3635,9 +3635,8 @@ static struct inode *shmem_alloc_inode(struct super_block *sb)
36353635
return &info->vfs_inode;
36363636
}
36373637

3638-
static void shmem_destroy_callback(struct rcu_head *head)
3638+
static void shmem_free_in_core_inode(struct inode *inode)
36393639
{
3640-
struct inode *inode = container_of(head, struct inode, i_rcu);
36413640
if (S_ISLNK(inode->i_mode))
36423641
kfree(inode->i_link);
36433642
kmem_cache_free(shmem_inode_cachep, SHMEM_I(inode));
@@ -3647,7 +3646,6 @@ static void shmem_destroy_inode(struct inode *inode)
36473646
{
36483647
if (S_ISREG(inode->i_mode))
36493648
mpol_free_shared_policy(&SHMEM_I(inode)->policy);
3650-
call_rcu(&inode->i_rcu, shmem_destroy_callback);
36513649
}
36523650

36533651
static void shmem_init_inode(void *foo)
@@ -3738,6 +3736,7 @@ static const struct inode_operations shmem_special_inode_operations = {
37383736

37393737
static const struct super_operations shmem_ops = {
37403738
.alloc_inode = shmem_alloc_inode,
3739+
.free_inode = shmem_free_in_core_inode,
37413740
.destroy_inode = shmem_destroy_inode,
37423741
#ifdef CONFIG_TMPFS
37433742
.statfs = shmem_statfs,

0 commit comments

Comments
 (0)