f2fs: use current_sit_addr to replace the open code
authorGu Zheng <guz.fnst@cn.fujitsu.com>
Mon, 20 Oct 2014 09:45:49 +0000 (17:45 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 4 Nov 2014 00:07:37 +0000 (16:07 -0800)
Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/segment.c

index 19de23b119fa99b787530b752d4d9dc6f9acd5d3..21ccc481647481f0d20f23258f67fdac9c549285 100644 (file)
@@ -1552,17 +1552,7 @@ int lookup_journal_in_cursum(struct f2fs_summary_block *sum, int type,
 static struct page *get_current_sit_page(struct f2fs_sb_info *sbi,
                                        unsigned int segno)
 {
-       struct sit_info *sit_i = SIT_I(sbi);
-       unsigned int offset = SIT_BLOCK_OFFSET(segno);
-       block_t blk_addr = sit_i->sit_base_addr + offset;
-
-       check_seg_range(sbi, segno);
-
-       /* calculate sit block address */
-       if (f2fs_test_bit(offset, sit_i->sit_bitmap))
-               blk_addr += sit_i->sit_blocks;
-
-       return get_meta_page(sbi, blk_addr);
+       return get_meta_page(sbi, current_sit_addr(sbi, segno));
 }
 
 static struct page *get_next_sit_page(struct f2fs_sb_info *sbi,