Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 435f2a1b authored by Haicheng Li's avatar Haicheng Li Committed by Jaegeuk Kim
Browse files

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: default avatarHaicheng Li <haicheng.li@linux.intel.com>
[Jaegeuk Kim: modify a comment related to this patch]
Signed-off-by: default avatarJaegeuk Kim <jaegeuk.kim@samsung.com>
parent cffbfa66
Loading
Loading
Loading
Loading
+7 −3
Original line number Original line Diff line number Diff line
@@ -78,10 +78,14 @@ static void __remove_dirty_segment(struct f2fs_sb_info *sbi, unsigned int segno,
	if (dirty_type == DIRTY) {
	if (dirty_type == DIRTY) {
		enum dirty_type t = DIRTY_HOT_DATA;
		enum dirty_type t = DIRTY_HOT_DATA;


		/* clear all the bitmaps */
		/* clear its dirty bitmap */
		for (; t <= DIRTY_COLD_NODE; t++)
		for (; t <= DIRTY_COLD_NODE; t++) {
			if (test_and_clear_bit(segno, dirty_i->dirty_segmap[t]))
			if (test_and_clear_bit(segno,
						dirty_i->dirty_segmap[t])) {
				dirty_i->nr_dirty[t]--;
				dirty_i->nr_dirty[t]--;
				break;
			}
		}


		if (get_valid_blocks(sbi, segno, sbi->segs_per_sec) == 0)
		if (get_valid_blocks(sbi, segno, sbi->segs_per_sec) == 0)
			clear_bit(GET_SECNO(sbi, segno),
			clear_bit(GET_SECNO(sbi, segno),