aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph
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 /fs/ceph
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 'fs/ceph')
-rw-r--r--fs/ceph/inode.c5
-rw-r--r--fs/ceph/super.c1
-rw-r--r--fs/ceph/super.h1
3 files changed, 3 insertions, 4 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index c2feb310ac1e..35dae6d5493a 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -519,9 +519,8 @@ struct inode *ceph_alloc_inode(struct super_block *sb)
519 return &ci->vfs_inode; 519 return &ci->vfs_inode;
520} 520}
521 521
522static void ceph_i_callback(struct rcu_head *head) 522void ceph_free_inode(struct inode *inode)
523{ 523{
524 struct inode *inode = container_of(head, struct inode, i_rcu);
525 struct ceph_inode_info *ci = ceph_inode(inode); 524 struct ceph_inode_info *ci = ceph_inode(inode);
526 525
527 kfree(ci->i_symlink); 526 kfree(ci->i_symlink);
@@ -581,8 +580,6 @@ void ceph_destroy_inode(struct inode *inode)
581 ceph_buffer_put(ci->i_xattrs.prealloc_blob); 580 ceph_buffer_put(ci->i_xattrs.prealloc_blob);
582 581
583 ceph_put_string(rcu_dereference_raw(ci->i_layout.pool_ns)); 582 ceph_put_string(rcu_dereference_raw(ci->i_layout.pool_ns));
584
585 call_rcu(&inode->i_rcu, ceph_i_callback);
586} 583}
587 584
588int ceph_drop_inode(struct inode *inode) 585int ceph_drop_inode(struct inode *inode)
diff --git a/fs/ceph/super.c b/fs/ceph/super.c
index 6d5bb2f74612..285edda4fc3b 100644
--- a/fs/ceph/super.c
+++ b/fs/ceph/super.c
@@ -848,6 +848,7 @@ static void ceph_umount_begin(struct super_block *sb)
848static const struct super_operations ceph_super_ops = { 848static const struct super_operations ceph_super_ops = {
849 .alloc_inode = ceph_alloc_inode, 849 .alloc_inode = ceph_alloc_inode,
850 .destroy_inode = ceph_destroy_inode, 850 .destroy_inode = ceph_destroy_inode,
851 .free_inode = ceph_free_inode,
851 .write_inode = ceph_write_inode, 852 .write_inode = ceph_write_inode,
852 .drop_inode = ceph_drop_inode, 853 .drop_inode = ceph_drop_inode,
853 .sync_fs = ceph_sync_fs, 854 .sync_fs = ceph_sync_fs,
diff --git a/fs/ceph/super.h b/fs/ceph/super.h
index 16c03188578e..c5b4a05905c0 100644
--- a/fs/ceph/super.h
+++ b/fs/ceph/super.h
@@ -874,6 +874,7 @@ extern const struct inode_operations ceph_file_iops;
874 874
875extern struct inode *ceph_alloc_inode(struct super_block *sb); 875extern struct inode *ceph_alloc_inode(struct super_block *sb);
876extern void ceph_destroy_inode(struct inode *inode); 876extern void ceph_destroy_inode(struct inode *inode);
877extern void ceph_free_inode(struct inode *inode);
877extern int ceph_drop_inode(struct inode *inode); 878extern int ceph_drop_inode(struct inode *inode);
878 879
879extern struct inode *ceph_get_inode(struct super_block *sb, 880extern struct inode *ceph_get_inode(struct super_block *sb,