summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2019-04-15 22:52:17 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2019-05-01 22:43:27 -0400
commit0b269ded4e608b1fda1f19ac7c48533ddaaafaeb (patch)
tree3be3b1a2accc21617381be02b727c0a182fc24a5
parentb3b4a6e356dbded14a0513fa0da4fe3ac1c5a33a (diff)
overlayfs: make use of ->free_inode()
synchronous parts are left in ->destroy_inode() Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/overlayfs/super.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
index 0116735cc321..5ec4fc2f5d7e 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -190,11 +190,13 @@ static struct inode *ovl_alloc_inode(struct super_block *sb)
190 return &oi->vfs_inode; 190 return &oi->vfs_inode;
191} 191}
192 192
193static void ovl_i_callback(struct rcu_head *head) 193static void ovl_free_inode(struct inode *inode)
194{ 194{
195 struct inode *inode = container_of(head, struct inode, i_rcu); 195 struct ovl_inode *oi = OVL_I(inode);
196 196
197 kmem_cache_free(ovl_inode_cachep, OVL_I(inode)); 197 kfree(oi->redirect);
198 mutex_destroy(&oi->lock);
199 kmem_cache_free(ovl_inode_cachep, oi);
198} 200}
199 201
200static void ovl_destroy_inode(struct inode *inode) 202static void ovl_destroy_inode(struct inode *inode)
@@ -207,10 +209,6 @@ static void ovl_destroy_inode(struct inode *inode)
207 ovl_dir_cache_free(inode); 209 ovl_dir_cache_free(inode);
208 else 210 else
209 iput(oi->lowerdata); 211 iput(oi->lowerdata);
210 kfree(oi->redirect);
211 mutex_destroy(&oi->lock);
212
213 call_rcu(&inode->i_rcu, ovl_i_callback);
214} 212}
215 213
216static void ovl_free_fs(struct ovl_fs *ofs) 214static void ovl_free_fs(struct ovl_fs *ofs)
@@ -377,6 +375,7 @@ static int ovl_remount(struct super_block *sb, int *flags, char *data)
377 375
378static const struct super_operations ovl_super_operations = { 376static const struct super_operations ovl_super_operations = {
379 .alloc_inode = ovl_alloc_inode, 377 .alloc_inode = ovl_alloc_inode,
378 .free_inode = ovl_free_inode,
380 .destroy_inode = ovl_destroy_inode, 379 .destroy_inode = ovl_destroy_inode,
381 .drop_inode = generic_delete_inode, 380 .drop_inode = generic_delete_inode,
382 .put_super = ovl_put_super, 381 .put_super = ovl_put_super,