... | ... | ||
---|---|---|---|
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 | next = find_next_bit(free_i->free_segmap, | ||
41 | start_segno + SEGS_PER_SEC(sbi), start_segno); | ||
40 | if (next >= start_segno + usable_segs) { | 42 | if (next >= start_segno + usable_segs) { |
41 | 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)) { | ||
42 | free_i->free_sections++; | 45 | free_i->free_sections++; |
43 | + | 46 | + |
44 | + if (GET_SEC_FROM_SEG(sbi->next_victim_seg[BG_GC]) == secno) | 47 | + if (GET_SEC_FROM_SEG(sbi, sbi->next_victim_seg[BG_GC]) == secno) |
45 | + sbi->next_victim_seg[BG_GC] = NULL_SEGNO; | 48 | + sbi->next_victim_seg[BG_GC] = NULL_SEGNO; |
46 | + | 49 | + |
47 | + if (GET_SEC_FROM_SEG(sbi->next_victim_seg[FG_GC]) == secno) | 50 | + if (GET_SEC_FROM_SEG(sbi, sbi->next_victim_seg[FG_GC]) == secno) |
48 | + sbi->next_victim_seg[FG_GC] = NULL_SEGNO; | 51 | + sbi->next_victim_seg[FG_GC] = NULL_SEGNO; |
52 | + } | ||
49 | } | 53 | } |
50 | } | 54 | } |
51 | skip_free: | 55 | skip_free: |
52 | -- | 56 | -- |
53 | 2.33.0 | 57 | 2.33.0 | diff view generated by jsdifflib |