...
...
27
- gc tries to migrate seg#1
27
- gc tries to migrate seg#1
28
28
29
Signed-off-by: yohan.joung <yohan.joung@sk.com>
29
Signed-off-by: yohan.joung <yohan.joung@sk.com>
30
Signed-off-by: Chao Yu <chao@kernel.org>
30
Signed-off-by: Chao Yu <chao@kernel.org>
31
---
31
---
32
fs/f2fs/segment.h | 6 ++++++
32
fs/f2fs/segment.h | 9 ++++++++-
33
1 file changed, 6 insertions(+)
33
1 file changed, 8 insertions(+), 1 deletion(-)
34
34
35
diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h
35
diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h
36
index XXXXXXX..XXXXXXX 100644
36
index XXXXXXX..XXXXXXX 100644
37
--- a/fs/f2fs/segment.h
37
--- a/fs/f2fs/segment.h
38
+++ b/fs/f2fs/segment.h
38
+++ b/fs/f2fs/segment.h
39
@@ -XXX,XX +XXX,XX @@ static inline void __set_test_and_free(struct f2fs_sb_info *sbi,
39
@@ -XXX,XX +XXX,XX @@ static inline void __set_test_and_free(struct f2fs_sb_info *sbi,
40
        unsigned int segno, bool inmem)
40
        next = find_next_bit(free_i->free_segmap,
41
{
41
                start_segno + SEGS_PER_SEC(sbi), start_segno);
42
    struct free_segmap_info *free_i = FREE_I(sbi);
43
+    struct dirty_seglist_info *dirty_i = DIRTY_I(sbi);
44
    unsigned int secno = GET_SEC_FROM_SEG(sbi, segno);
45
    unsigned int start_segno = GET_SEG_FROM_SEC(sbi, secno);
46
    unsigned int next;
47
@@ -XXX,XX +XXX,XX @@ static inline void __set_test_and_free(struct f2fs_sb_info *sbi,
48
        if (next >= start_segno + usable_segs) {
42
        if (next >= start_segno + usable_segs) {
49
            if (test_and_clear_bit(secno, free_i->free_secmap))
43
-            if (test_and_clear_bit(secno, free_i->free_secmap))
44
+            if (test_and_clear_bit(secno, free_i->free_secmap)) {
50
                free_i->free_sections++;
45
                free_i->free_sections++;
51
+
46
+
52
+            if (test_and_clear_bit(secno, dirty_i->victim_secmap)) {
47
+                if (GET_SEC_FROM_SEG(sbi, sbi->next_victim_seg[BG_GC]) == secno)
53
+                sbi->next_victim_seg[BG_GC] = NULL_SEGNO;
48
+                    sbi->next_victim_seg[BG_GC] = NULL_SEGNO;
54
+                sbi->next_victim_seg[FG_GC] = NULL_SEGNO;
49
+
50
+                if (GET_SEC_FROM_SEG(sbi, sbi->next_victim_seg[FG_GC]) == secno)
51
+                    sbi->next_victim_seg[FG_GC] = NULL_SEGNO;
55
+            }
52
+            }
56
        }
53
        }
57
    }
54
    }
58
skip_free:
55
skip_free:
59
--
56
--
60
2.33.0
57
2.33.0
diff view generated by jsdifflib