[PATCH] f2fs: merge the two conditions to avoid code duplication

mason.zhang posted 1 patch 2 months, 2 weeks ago
fs/f2fs/gc.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
[PATCH] f2fs: merge the two conditions to avoid code duplication
Posted by mason.zhang 2 months, 2 weeks ago
No functional changes.

Signed-off-by: mason.zhang <masonzhang.linuxer@gmail.com>
---
 fs/f2fs/gc.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index 3cb5242f4ddf..2df02e36fd5f 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -278,12 +278,7 @@ static void select_policy(struct f2fs_sb_info *sbi, int gc_type,
 {
 	struct dirty_seglist_info *dirty_i = DIRTY_I(sbi);
 
-	if (p->alloc_mode == SSR) {
-		p->gc_mode = GC_GREEDY;
-		p->dirty_bitmap = dirty_i->dirty_segmap[type];
-		p->max_search = dirty_i->nr_dirty[type];
-		p->ofs_unit = 1;
-	} else if (p->alloc_mode == AT_SSR) {
+	if (p->alloc_mode == SSR || p->alloc_mode == AT_SSR) {
 		p->gc_mode = GC_GREEDY;
 		p->dirty_bitmap = dirty_i->dirty_segmap[type];
 		p->max_search = dirty_i->nr_dirty[type];
-- 
2.50.0
Re: [PATCH] f2fs: merge the two conditions to avoid code duplication
Posted by Chao Yu 2 months, 2 weeks ago
On 7/23/25 22:58, mason.zhang wrote:
> No functional changes.
> 
> Signed-off-by: mason.zhang <masonzhang.linuxer@gmail.com>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,