summaryrefslogtreecommitdiffstats
path: root/fs/nilfs2/super.c
diff options
context:
space:
mode:
authorRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2016-05-23 16:23:20 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2016-05-23 17:04:14 -0700
commit2d19961d83524c69e44f179b43aee2daf0906eda (patch)
treebd65c4e61733de1fc2077fead93958c7388b0c74 /fs/nilfs2/super.c
parent24e20ead2fb2e1b67a76a04550d29c9027f707eb (diff)
downloadlinux-2d19961d83524c69e44f179b43aee2daf0906eda.tar.bz2
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>
Diffstat (limited to 'fs/nilfs2/super.c')
-rw-r--r--fs/nilfs2/super.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c
index 2ed3e4008e72..2cb78b857df6 100644
--- a/fs/nilfs2/super.c
+++ b/fs/nilfs2/super.c
@@ -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));
}