diff options
author | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-03-30 23:59:53 -0400 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-04-03 04:27:49 -0400 |
commit | 33afa7fde0defbb362328233e600e052d0a22cd5 (patch) | |
tree | 839e84c84ad0971aaeb7cbaa9163df98d27a6728 /fs/f2fs | |
parent | 56ae674cc27230ea86ab25db7fcf1f32dfe17ec1 (diff) |
f2fs: allocate new segment aligned with sections
When allocating a new segment under the LFS mode, we should keep the section
boundary.
Reviewed-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs')
-rw-r--r-- | fs/f2fs/segment.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 179a13e86f69..b3486f34af78 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c | |||
@@ -362,7 +362,8 @@ static void get_new_segment(struct f2fs_sb_info *sbi, | |||
362 | if (!new_sec && ((*newseg + 1) % sbi->segs_per_sec)) { | 362 | if (!new_sec && ((*newseg + 1) % sbi->segs_per_sec)) { |
363 | segno = find_next_zero_bit(free_i->free_segmap, | 363 | segno = find_next_zero_bit(free_i->free_segmap, |
364 | TOTAL_SEGS(sbi), *newseg + 1); | 364 | TOTAL_SEGS(sbi), *newseg + 1); |
365 | if (segno < TOTAL_SEGS(sbi)) | 365 | if (segno - *newseg < sbi->segs_per_sec - |
366 | (*newseg % sbi->segs_per_sec)) | ||
366 | goto got_it; | 367 | goto got_it; |
367 | } | 368 | } |
368 | find_other_zone: | 369 | find_other_zone: |