aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs
diff options
context:
space:
mode:
authorChao Yu <chao2.yu@samsung.com>2014-07-14 04:45:15 -0400
committerJaegeuk Kim <jaegeuk@kernel.org>2014-07-15 16:56:49 -0400
commitf1121ab0ba9ab9c1592049533b511877600f409e (patch)
treeee9f8ef4ae8069a9e6decb45f72e72d910d11e0a /fs/f2fs
parent4b2868aa4f07eeb64e96c2e0823387c426eca356 (diff)
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')
-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,
347 if (test_and_clear_bit(segno, free_i->free_segmap)) { 347 if (test_and_clear_bit(segno, free_i->free_segmap)) {
348 free_i->free_segments++; 348 free_i->free_segments++;
349 349
350 next = find_next_bit(free_i->free_segmap, TOTAL_SEGS(sbi), 350 next = find_next_bit(free_i->free_segmap,
351 start_segno); 351 start_segno + sbi->segs_per_sec, start_segno);
352 if (next >= start_segno + sbi->segs_per_sec) { 352 if (next >= start_segno + sbi->segs_per_sec) {
353 if (test_and_clear_bit(secno, free_i->free_secmap)) 353 if (test_and_clear_bit(secno, free_i->free_secmap))
354 free_i->free_sections++; 354 free_i->free_sections++;