aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nilfs2/mdt.c
diff options
context:
space:
mode:
authorRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2009-11-12 12:25:41 -0500
committerRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2009-11-19 20:05:48 -0500
commitfd66c0d5c377ee8146909d0eb9258539e4b0f293 (patch)
tree7fefab4c3108aff9d18943a17cd3522a53bdc3bd /fs/nilfs2/mdt.c
parent3961f0e2775f84a8f81b0dcddb0b356ebfe0696b (diff)
nilfs2: hide nilfs_mdt_clear calls in nilfs_mdt_destroy
This will hide a function call of nilfs_mdt_clear() in nilfs_mdt_destroy(). This ensures nilfs_mdt_destroy() to do cleanup jobs included in nilfs_mdt_clear(). Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Diffstat (limited to 'fs/nilfs2/mdt.c')
-rw-r--r--fs/nilfs2/mdt.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/nilfs2/mdt.c b/fs/nilfs2/mdt.c
index 62074e8d25cb..3028e8f31be2 100644
--- a/fs/nilfs2/mdt.c
+++ b/fs/nilfs2/mdt.c
@@ -553,14 +553,15 @@ void nilfs_mdt_set_shadow(struct inode *orig, struct inode *shadow)
553 &NILFS_I(orig)->i_btnode_cache; 553 &NILFS_I(orig)->i_btnode_cache;
554} 554}
555 555
556void nilfs_mdt_clear(struct inode *inode) 556static void nilfs_mdt_clear(struct inode *inode)
557{ 557{
558 struct nilfs_inode_info *ii = NILFS_I(inode); 558 struct nilfs_inode_info *ii = NILFS_I(inode);
559 559
560 invalidate_mapping_pages(inode->i_mapping, 0, -1); 560 invalidate_mapping_pages(inode->i_mapping, 0, -1);
561 truncate_inode_pages(inode->i_mapping, 0); 561 truncate_inode_pages(inode->i_mapping, 0);
562 562
563 nilfs_bmap_clear(ii->i_bmap); 563 if (test_bit(NILFS_I_BMAP, &ii->i_state))
564 nilfs_bmap_clear(ii->i_bmap);
564 nilfs_btnode_cache_clear(&ii->i_btnode_cache); 565 nilfs_btnode_cache_clear(&ii->i_btnode_cache);
565} 566}
566 567
@@ -568,6 +569,8 @@ void nilfs_mdt_destroy(struct inode *inode)
568{ 569{
569 struct nilfs_mdt_info *mdi = NILFS_MDT(inode); 570 struct nilfs_mdt_info *mdi = NILFS_MDT(inode);
570 571
572 nilfs_mdt_clear(inode);
573
571 kfree(mdi->mi_bgl); /* kfree(NULL) is safe */ 574 kfree(mdi->mi_bgl); /* kfree(NULL) is safe */
572 kfree(mdi); 575 kfree(mdi);
573 nilfs_destroy_inode(inode); 576 nilfs_destroy_inode(inode);