summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/segment.h
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2022-06-28 19:57:24 +0200
committerJaegeuk Kim <jaegeuk@kernel.org>2022-07-31 05:16:20 +0200
commitb771aadc6e4c221a468fe4a2dfcfffec01a06722 (patch)
treee8e14676e8157399631dce525cfec60ff7857965 /fs/f2fs/segment.h
parentf2fs: remove redundant code for gc condition (diff)
downloadlinux-b771aadc6e4c221a468fe4a2dfcfffec01a06722.tar.xz
linux-b771aadc6e4c221a468fe4a2dfcfffec01a06722.zip
f2fs: enforce single zone capacity
In order to simplify the complicated per-zone capacity, let's support only one capacity for entire zoned device. Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/segment.h')
-rw-r--r--fs/f2fs/segment.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h
index 3f277dfcb131..813a892cd979 100644
--- a/fs/f2fs/segment.h
+++ b/fs/f2fs/segment.h
@@ -101,6 +101,9 @@ static inline void sanity_check_seg_type(struct f2fs_sb_info *sbi,
GET_SEGNO_FROM_SEG0(sbi, blk_addr)))
#define BLKS_PER_SEC(sbi) \
((sbi)->segs_per_sec * (sbi)->blocks_per_seg)
+#define CAP_BLKS_PER_SEC(sbi) \
+ ((sbi)->segs_per_sec * (sbi)->blocks_per_seg - \
+ (sbi)->unusable_blocks_per_sec)
#define GET_SEC_FROM_SEG(sbi, segno) \
(((segno) == -1) ? -1: (segno) / (sbi)->segs_per_sec)
#define GET_SEG_FROM_SEC(sbi, secno) \