diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2022-06-28 20:03:57 +0200 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2022-07-31 05:16:20 +0200 |
commit | 074b5ea2900ea8e40f8e7a3fd37e0a55ad3d5874 (patch) | |
tree | c16bb9fa8956d53391c579ac33d608a102d2c8ee /fs/f2fs/file.c | |
parent | f2fs: enforce single zone capacity (diff) | |
download | linux-074b5ea2900ea8e40f8e7a3fd37e0a55ad3d5874.tar.xz linux-074b5ea2900ea8e40f8e7a3fd37e0a55ad3d5874.zip |
f2fs: adjust zone capacity when considering valid block count
This patch fixes counting unusable blocks set by zone capacity when
checking the valid block count in a section.
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/file.c')
-rw-r--r-- | fs/f2fs/file.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 2d1114b0ceef..0f29af7876a6 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -1681,7 +1681,7 @@ static int expand_inode_data(struct inode *inode, loff_t offset, return 0; if (f2fs_is_pinned_file(inode)) { - block_t sec_blks = BLKS_PER_SEC(sbi); + block_t sec_blks = CAP_BLKS_PER_SEC(sbi); block_t sec_len = roundup(map.m_len, sec_blks); map.m_len = sec_blks; @@ -2432,7 +2432,7 @@ do_more: ret = -EAGAIN; goto out; } - range->start += BLKS_PER_SEC(sbi); + range->start += CAP_BLKS_PER_SEC(sbi); if (range->start <= end) goto do_more; out: @@ -2557,7 +2557,7 @@ static int f2fs_defragment_range(struct f2fs_sb_info *sbi, goto out; } - sec_num = DIV_ROUND_UP(total, BLKS_PER_SEC(sbi)); + sec_num = DIV_ROUND_UP(total, CAP_BLKS_PER_SEC(sbi)); /* * make sure there are enough free section for LFS allocation, this can |