Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

f2fs: reduce searching region of segmap when set free section

In __set_free we will check whether all segment are free in one section
when free one segment, in order to set section to free status. But the
searching region of segmap is from start segno to last segno of main
area, it's not necessary. So let's just only check all segment bitmap
of target section.

Signed-off-by: Wanpeng Li <wanpeng.li@linux.intel.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>

authored by

Wanpeng Li and committed by
Jaegeuk Kim
7fd97019 fdf6c8be

+2 -1
+2 -1
fs/f2fs/segment.h
··· 336 336 clear_bit(segno, free_i->free_segmap); 337 337 free_i->free_segments++; 338 338 339 - next = find_next_bit(free_i->free_segmap, MAIN_SEGS(sbi), start_segno); 339 + next = find_next_bit(free_i->free_segmap, 340 + start_segno + sbi->segs_per_sec, start_segno); 340 341 if (next >= start_segno + sbi->segs_per_sec) { 341 342 clear_bit(secno, free_i->free_secmap); 342 343 free_i->free_sections++;