summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/f2fs.h
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/f2fs.h
parent9006f2c93fe5cc450bc0d3a4924b46393f165b4a (diff)
downloadlinux-3519e3f992995d46c200134cfbf84c61b7a01f4c.tar.gz
linux-3519e3f992995d46c200134cfbf84c61b7a01f4c.tar.bz2
linux-3519e3f992995d46c200134cfbf84c61b7a01f4c.zip
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/f2fs.h')
-rw-r--r--fs/f2fs/f2fs.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 0831db2f4b3a..0052ae8bea3f 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -1099,8 +1099,7 @@ static inline int get_dirty_pages(struct inode *inode)
static inline int get_blocktype_secs(struct f2fs_sb_info *sbi, int block_type)
{
- unsigned int pages_per_sec = sbi->segs_per_sec *
- (1 << sbi->log_blocks_per_seg);
+ unsigned int pages_per_sec = sbi->segs_per_sec * sbi->blocks_per_seg;
return ((get_pages(sbi, block_type) + pages_per_sec - 1)
>> sbi->log_blocks_per_seg) / sbi->segs_per_sec;
}