Revert "f2fs: add a new function get_ssr_cost"
authorYunlong Song <yunlong.song@huawei.com>
Mon, 4 Sep 2017 03:10:18 +0000 (11:10 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 5 Sep 2017 17:52:28 +0000 (10:52 -0700)
This reverts commit b7b7c4cf1c9ef0272a65f1480457cbfdadcda19d.

se->ckpt_valid_blocks will never be smaller than se->valid_blocks, so just
remove get_ssr_cost.

Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/gc.c

index cd147e7c71e8fcd642da013e4fdde24413b55fca..b226760afba80f5aa33afd6e284e649bc981ca88 100644 (file)
@@ -277,20 +277,11 @@ static unsigned int get_greedy_cost(struct f2fs_sb_info *sbi,
                                valid_blocks * 2 : valid_blocks;
 }
 
-static unsigned int get_ssr_cost(struct f2fs_sb_info *sbi,
-                                               unsigned int segno)
-{
-       struct seg_entry *se = get_seg_entry(sbi, segno);
-
-       return se->ckpt_valid_blocks > se->valid_blocks ?
-                               se->ckpt_valid_blocks : se->valid_blocks;
-}
-
 static inline unsigned int get_gc_cost(struct f2fs_sb_info *sbi,
                        unsigned int segno, struct victim_sel_policy *p)
 {
        if (p->alloc_mode == SSR)
-               return get_ssr_cost(sbi, segno);
+               return get_seg_entry(sbi, segno)->ckpt_valid_blocks;
 
        /* alloc_mode == LFS */
        if (p->gc_mode == GC_GREEDY)