diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2017-04-07 15:08:17 -0700 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2017-04-10 19:48:13 -0700 |
commit | 4ddb1a4d4dc20642073b7d92400a67b67601fe6f (patch) | |
tree | c39f403ca64b70dedaad2b93b210e1b66fe99aa8 /fs/f2fs/file.c | |
parent | 302bd34882b1e20797f08cc13ef060ec972d0acb (diff) | |
download | linux-4ddb1a4d4dc20642073b7d92400a67b67601fe6f.tar.gz linux-4ddb1a4d4dc20642073b7d92400a67b67601fe6f.tar.bz2 linux-4ddb1a4d4dc20642073b7d92400a67b67601fe6f.zip |
f2fs: clean up some macros in terms of GET_SEGNO
This patch cleans several macros by introducing:
- BLKS_PER_SEC
- GET_SEC_FROM_SEG
- GET_SEG_FROM_SEC
- GET_ZONE_FROM_SEC
- GET_ZONE_FROM_SEG
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/file.c')
-rw-r--r-- | fs/f2fs/file.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index f3be240ef129..4731eb587e06 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -1892,7 +1892,6 @@ static int f2fs_defragment_range(struct f2fs_sb_info *sbi, pgoff_t pg_start, pg_end; unsigned int blk_per_seg = sbi->blocks_per_seg; unsigned int total = 0, sec_num; - unsigned int pages_per_sec = sbi->segs_per_sec * blk_per_seg; block_t blk_end = 0; bool fragmented = false; int err; @@ -1956,7 +1955,7 @@ static int f2fs_defragment_range(struct f2fs_sb_info *sbi, map.m_lblk = pg_start; map.m_len = pg_end - pg_start; - sec_num = (map.m_len + pages_per_sec - 1) / pages_per_sec; + sec_num = (map.m_len + BLKS_PER_SEC(sbi) - 1) / BLKS_PER_SEC(sbi); /* * make sure there are enough free section for LFS allocation, this can |