nilfs2: move cleanup code of metadata file from inode routines
Refactor nilfs_clear_inode() and nilfs_i_callback() so that cleanup code or resource deallocation related to metadata file will be moved out to mdt.c. Link: http://lkml.kernel.org/r/1461935747-10380-9-git-send-email-konishi.ryusuke@lab.ntt.co.jp Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:

committed by
Linus Torvalds

parent
24e20ead2f
commit
2d19961d83
@@ -169,12 +169,10 @@ struct inode *nilfs_alloc_inode(struct super_block *sb)
|
||||
static void nilfs_i_callback(struct rcu_head *head)
|
||||
{
|
||||
struct inode *inode = container_of(head, struct inode, i_rcu);
|
||||
struct nilfs_mdt_info *mdi = NILFS_MDT(inode);
|
||||
|
||||
if (mdi) {
|
||||
kfree(mdi->mi_bgl); /* kfree(NULL) is safe */
|
||||
kfree(mdi);
|
||||
}
|
||||
if (nilfs_is_metadata_file_inode(inode))
|
||||
nilfs_mdt_destroy(inode);
|
||||
|
||||
kmem_cache_free(nilfs_inode_cachep, NILFS_I(inode));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user