lkml.org 
[lkml]   [2017]   [Sep]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] f2fs: clear get_ssr_cost
Date
se->ckpt_valid_blocks is always larger than se->valid_blocks, so
get_ssr_cost can be cleared.

Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
---
fs/f2fs/gc.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index cd147e7..b226760 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -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)
--
1.8.5.2
\
 
 \ /
  Last update: 2017-09-01 14:16    [W:0.040 / U:2.384 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site