aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs
diff options
context:
space:
mode:
authorHaicheng Li <haicheng.li@linux.intel.com>2013-10-18 05:24:08 -0400
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2013-10-22 06:57:31 -0400
commit435f2a1b58ac8f50894f23549c97791085f7cba2 (patch)
tree6f8bfb66fc20019dedbafc9215ce7abb46b0d2a7 /fs/f2fs
parentcffbfa66485e4940091d7e64024e802314d24c09 (diff)
f2fs: no need to check other dirty_segmap when the seg has been found
Because one dirty seg can only be mapped to one dirty_type. Otherwise, it's a bug. Signed-off-by: Haicheng Li <haicheng.li@linux.intel.com> [Jaegeuk Kim: modify a comment related to this patch] Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs')
-rw-r--r--fs/f2fs/segment.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 862fef3ae253..8ac161965242 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -78,10 +78,14 @@ static void __remove_dirty_segment(struct f2fs_sb_info *sbi, unsigned int segno,
78 if (dirty_type == DIRTY) { 78 if (dirty_type == DIRTY) {
79 enum dirty_type t = DIRTY_HOT_DATA; 79 enum dirty_type t = DIRTY_HOT_DATA;
80 80
81 /* clear all the bitmaps */ 81 /* clear its dirty bitmap */
82 for (; t <= DIRTY_COLD_NODE; t++) 82 for (; t <= DIRTY_COLD_NODE; t++) {
83 if (test_and_clear_bit(segno, dirty_i->dirty_segmap[t])) 83 if (test_and_clear_bit(segno,
84 dirty_i->dirty_segmap[t])) {
84 dirty_i->nr_dirty[t]--; 85 dirty_i->nr_dirty[t]--;
86 break;
87 }
88 }
85 89
86 if (get_valid_blocks(sbi, segno, sbi->segs_per_sec) == 0) 90 if (get_valid_blocks(sbi, segno, sbi->segs_per_sec) == 0)
87 clear_bit(GET_SECNO(sbi, segno), 91 clear_bit(GET_SECNO(sbi, segno),