if (dirty_type == DIRTY) {
enum dirty_type t = DIRTY_HOT_DATA;
- /* clear all the bitmaps */
- for (; t <= DIRTY_COLD_NODE; t++)
- if (test_and_clear_bit(segno, dirty_i->dirty_segmap[t]))
+ /* clear its dirty bitmap */
+ for (; t <= DIRTY_COLD_NODE; t++) {
+ if (test_and_clear_bit(segno,
+ dirty_i->dirty_segmap[t])) {
dirty_i->nr_dirty[t]--;
+ break;
+ }
+ }
if (get_valid_blocks(sbi, segno, sbi->segs_per_sec) == 0)
clear_bit(GET_SECNO(sbi, segno),
change_curseg(sbi, type, true);
else
new_curseg(sbi, type, false);
-#ifdef CONFIG_F2FS_STAT_FS
- sbi->segment_count[curseg->alloc_type]++;
-#endif
+
+ stat_inc_alloc_type(sbi, curseg);
}
void allocate_new_segments(struct f2fs_sb_info *sbi)
mutex_lock(&sit_i->sentry_lock);
__refresh_next_blkoff(sbi, curseg);
-#ifdef CONFIG_F2FS_STAT_FS
- sbi->block_count[curseg->alloc_type]++;
-#endif
+
+ stat_inc_alloc_type(sbi, curseg);
/*
* SIT information should be updated before segment allocation,
__mark_sit_entry_dirty(sbi, segno);
}
update_sits_in_cursum(sum, -sits_in_cursum(sum));
- return 1;
+ return true;
}
- return 0;
+ return false;
}
/*