summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-05-07 13:57:05 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-05-07 13:57:05 -0400
commit168e153d5ebbdd6a3fa85db1cc4879ed4b7030e0 (patch)
tree73d8583ff7a53a05f95e331ac6468e3741f20d10 /mm
parent8ff468c29e9a9c3afe9152c10c7b141343270bf3 (diff)
parentf276ae0dd6d0b5bfbcb51178a63f06dc035f4cc4 (diff)
Merge branch 'work.icache' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs inode freeing updates from Al Viro: "Introduction of separate method for RCU-delayed part of ->destroy_inode() (if any). Pretty much as posted, except that destroy_inode() stashes ->free_inode into the victim (anon-unioned with ->i_fops) before scheduling i_callback() and the last two patches (sockfs conversion and folding struct socket_wq into struct socket) are excluded - that pair should go through netdev once davem reopens his tree" * 'work.icache' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (58 commits) orangefs: make use of ->free_inode() shmem: make use of ->free_inode() hugetlb: make use of ->free_inode() overlayfs: make use of ->free_inode() jfs: switch to ->free_inode() fuse: switch to ->free_inode() ext4: make use of ->free_inode() ecryptfs: make use of ->free_inode() ceph: use ->free_inode() btrfs: use ->free_inode() afs: switch to use of ->free_inode() dax: make use of ->free_inode() ntfs: switch to ->free_inode() securityfs: switch to ->free_inode() apparmor: switch to ->free_inode() rpcpipe: switch to ->free_inode() bpf: switch to ->free_inode() mqueue: switch to ->free_inode() ufs: switch to ->free_inode() coda: switch to ->free_inode() ...
Diffstat (limited to 'mm')
-rw-r--r--mm/shmem.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/mm/shmem.c b/mm/shmem.c
index 2275a0ff7c30..f4dce9c8670d 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -3631,9 +3631,8 @@ static struct inode *shmem_alloc_inode(struct super_block *sb)
3631 return &info->vfs_inode; 3631 return &info->vfs_inode;
3632} 3632}
3633 3633
3634static void shmem_destroy_callback(struct rcu_head *head) 3634static void shmem_free_in_core_inode(struct inode *inode)
3635{ 3635{
3636 struct inode *inode = container_of(head, struct inode, i_rcu);
3637 if (S_ISLNK(inode->i_mode)) 3636 if (S_ISLNK(inode->i_mode))
3638 kfree(inode->i_link); 3637 kfree(inode->i_link);
3639 kmem_cache_free(shmem_inode_cachep, SHMEM_I(inode)); 3638 kmem_cache_free(shmem_inode_cachep, SHMEM_I(inode));
@@ -3643,7 +3642,6 @@ static void shmem_destroy_inode(struct inode *inode)
3643{ 3642{
3644 if (S_ISREG(inode->i_mode)) 3643 if (S_ISREG(inode->i_mode))
3645 mpol_free_shared_policy(&SHMEM_I(inode)->policy); 3644 mpol_free_shared_policy(&SHMEM_I(inode)->policy);
3646 call_rcu(&inode->i_rcu, shmem_destroy_callback);
3647} 3645}
3648 3646
3649static void shmem_init_inode(void *foo) 3647static void shmem_init_inode(void *foo)
@@ -3734,6 +3732,7 @@ static const struct inode_operations shmem_special_inode_operations = {
3734 3732
3735static const struct super_operations shmem_ops = { 3733static const struct super_operations shmem_ops = {
3736 .alloc_inode = shmem_alloc_inode, 3734 .alloc_inode = shmem_alloc_inode,
3735 .free_inode = shmem_free_in_core_inode,
3737 .destroy_inode = shmem_destroy_inode, 3736 .destroy_inode = shmem_destroy_inode,
3738#ifdef CONFIG_TMPFS 3737#ifdef CONFIG_TMPFS
3739 .statfs = shmem_statfs, 3738 .statfs = shmem_statfs,