Skip to content

Commit 0b269de

Browse files
author
Al Viro
committed
overlayfs: make use of ->free_inode()
synchronous parts are left in ->destroy_inode() Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent b3b4a6e commit 0b269de

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

‎fs/overlayfs/super.c‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,13 @@ static struct inode *ovl_alloc_inode(struct super_block *sb)
190190
return &oi->vfs_inode;
191191
}
192192

193-
static void ovl_i_callback(struct rcu_head *head)
193+
static void ovl_free_inode(struct inode *inode)
194194
{
195-
struct inode *inode = container_of(head, struct inode, i_rcu);
195+
struct ovl_inode *oi = OVL_I(inode);
196196

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);
198200
}
199201

200202
static void ovl_destroy_inode(struct inode *inode)
@@ -207,10 +209,6 @@ static void ovl_destroy_inode(struct inode *inode)
207209
ovl_dir_cache_free(inode);
208210
else
209211
iput(oi->lowerdata);
210-
kfree(oi->redirect);
211-
mutex_destroy(&oi->lock);
212-
213-
call_rcu(&inode->i_rcu, ovl_i_callback);
214212
}
215213

216214
static void ovl_free_fs(struct ovl_fs *ofs)
@@ -377,6 +375,7 @@ static int ovl_remount(struct super_block *sb, int *flags, char *data)
377375

378376
static const struct super_operations ovl_super_operations = {
379377
.alloc_inode = ovl_alloc_inode,
378+
.free_inode = ovl_free_inode,
380379
.destroy_inode = ovl_destroy_inode,
381380
.drop_inode = generic_delete_inode,
382381
.put_super = ovl_put_super,

0 commit comments

Comments
 (0)