summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorWanpeng Li <wanpeng.li@linux.intel.com>2015-03-06 15:00:55 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2015-04-10 15:08:36 -0700
commit7fd97019b8db0668a4eb8b08d707bdce9f51d58e (patch)
tree88f94bba8aa43012b20faabd80ebb892888d886c /fs
parentfdf6c8be337af72b066548f325abcbcdf626dea8 (diff)
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>
Diffstat (limited to 'fs')
-rw-r--r--fs/f2fs/segment.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h
index 7fd35111cf62..85d7fa7514b2 100644
--- a/fs/f2fs/segment.h
+++ b/fs/f2fs/segment.h
@@ -336,7 +336,8 @@ static inline void __set_free(struct f2fs_sb_info *sbi, unsigned int segno)
clear_bit(segno, free_i->free_segmap);
free_i->free_segments++;
- next = find_next_bit(free_i->free_segmap, MAIN_SEGS(sbi), start_segno);
+ next = find_next_bit(free_i->free_segmap,
+ start_segno + sbi->segs_per_sec, start_segno);
if (next >= start_segno + sbi->segs_per_sec) {
clear_bit(secno, free_i->free_secmap);
free_i->free_sections++;