summaryrefslogtreecommitdiff
path: root/fs/f2fs/file.c
diff options
context:
space:
mode:
authorChao Yu <chao2.yu@samsung.com>2015-12-01 11:56:52 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2015-12-04 12:07:57 -0800
commit3519e3f992995d46c200134cfbf84c61b7a01f4c (patch)
tree74377f8e784a9d32c68505b2d9ac2751db66b509 /fs/f2fs/file.c
parent9006f2c93fe5cc450bc0d3a4924b46393f165b4a (diff)
f2fs: use sbi->blocks_per_seg to avoid unnecessary calculation
Use sbi->blocks_per_seg directly to avoid unnecessary calculation when using 1 << sbi->log_blocks_per_seg. Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/file.c')
-rw-r--r--fs/f2fs/file.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 3f1026caf807..96e4e048a8a1 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -1654,10 +1654,9 @@ static int f2fs_defragment_range(struct f2fs_sb_info *sbi,
struct f2fs_map_blocks map;
struct extent_info ei;
pgoff_t pg_start, pg_end;
- unsigned int blk_per_seg = 1 << sbi->log_blocks_per_seg;
+ unsigned int blk_per_seg = sbi->blocks_per_seg;
unsigned int total = 0, sec_num;
- unsigned int pages_per_sec = sbi->segs_per_sec *
- (1 << sbi->log_blocks_per_seg);
+ unsigned int pages_per_sec = sbi->segs_per_sec * blk_per_seg;
block_t blk_end = 0;
bool fragmented = false;
int err;