summaryrefslogtreecommitdiff
path: root/fs/f2fs/segment.h
diff options
context:
space:
mode:
authorChao Yu <chao2.yu@samsung.com>2014-07-14 12:45:15 +0400
committerJaegeuk Kim <jaegeuk@kernel.org>2014-07-16 00:56:49 +0400
commitf1121ab0ba9ab9c1592049533b511877600f409e (patch)
treeee9f8ef4ae8069a9e6decb45f72e72d910d11e0a /fs/f2fs/segment.h
parent4b2868aa4f07eeb64e96c2e0823387c426eca356 (diff)
downloadlinux-f1121ab0ba9ab9c1592049533b511877600f409e.tar.xz
f2fs: reduce searching region of segmap when free section
In __set_test_and_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 f2fs, it's not necessary. So let's just only check all segment bitmap of target section. Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/segment.h')
-rw-r--r--fs/f2fs/segment.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h
index 7091204680f4..ee5c75e08d9c 100644
--- a/fs/f2fs/segment.h
+++ b/fs/f2fs/segment.h
@@ -347,8 +347,8 @@ static inline void __set_test_and_free(struct f2fs_sb_info *sbi,
if (test_and_clear_bit(segno, free_i->free_segmap)) {
free_i->free_segments++;
- next = find_next_bit(free_i->free_segmap, TOTAL_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) {
if (test_and_clear_bit(secno, free_i->free_secmap))
free_i->free_sections++;