diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2019-04-15 23:19:05 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2019-05-01 22:43:27 -0400 |
commit | 74b1da5645cc4610d7eb5eb26a6609ed0d2e0fb2 (patch) | |
tree | 65c8cf9df7d6a50f578020423891cbe1f3156494 /mm/shmem.c | |
parent | b62de322579702f07175fc275ecb2c3afae6cd96 (diff) |
shmem: make use of ->free_inode()
same situation as for hugetlbfs
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'mm/shmem.c')
-rw-r--r-- | mm/shmem.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/mm/shmem.c b/mm/shmem.c index b3db3779a30a..dbb7a6dadba7 100644 --- a/mm/shmem.c +++ b/mm/shmem.c | |||
@@ -3635,9 +3635,8 @@ static struct inode *shmem_alloc_inode(struct super_block *sb) | |||
3635 | return &info->vfs_inode; | 3635 | return &info->vfs_inode; |
3636 | } | 3636 | } |
3637 | 3637 | ||
3638 | static void shmem_destroy_callback(struct rcu_head *head) | 3638 | static void shmem_free_in_core_inode(struct inode *inode) |
3639 | { | 3639 | { |
3640 | struct inode *inode = container_of(head, struct inode, i_rcu); | ||
3641 | if (S_ISLNK(inode->i_mode)) | 3640 | if (S_ISLNK(inode->i_mode)) |
3642 | kfree(inode->i_link); | 3641 | kfree(inode->i_link); |
3643 | kmem_cache_free(shmem_inode_cachep, SHMEM_I(inode)); | 3642 | kmem_cache_free(shmem_inode_cachep, SHMEM_I(inode)); |
@@ -3647,7 +3646,6 @@ static void shmem_destroy_inode(struct inode *inode) | |||
3647 | { | 3646 | { |
3648 | if (S_ISREG(inode->i_mode)) | 3647 | if (S_ISREG(inode->i_mode)) |
3649 | mpol_free_shared_policy(&SHMEM_I(inode)->policy); | 3648 | mpol_free_shared_policy(&SHMEM_I(inode)->policy); |
3650 | call_rcu(&inode->i_rcu, shmem_destroy_callback); | ||
3651 | } | 3649 | } |
3652 | 3650 | ||
3653 | static void shmem_init_inode(void *foo) | 3651 | static void shmem_init_inode(void *foo) |
@@ -3738,6 +3736,7 @@ static const struct inode_operations shmem_special_inode_operations = { | |||
3738 | 3736 | ||
3739 | static const struct super_operations shmem_ops = { | 3737 | static const struct super_operations shmem_ops = { |
3740 | .alloc_inode = shmem_alloc_inode, | 3738 | .alloc_inode = shmem_alloc_inode, |
3739 | .free_inode = shmem_free_in_core_inode, | ||
3741 | .destroy_inode = shmem_destroy_inode, | 3740 | .destroy_inode = shmem_destroy_inode, |
3742 | #ifdef CONFIG_TMPFS | 3741 | #ifdef CONFIG_TMPFS |
3743 | .statfs = shmem_statfs, | 3742 | .statfs = shmem_statfs, |