summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/segment.h
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2016-12-05 13:56:04 -0800
committerJaegeuk Kim <jaegeuk@kernel.org>2016-12-07 14:37:33 -0800
commit2040fce83fe17763b07c97c1f691da2bb85e4135 (patch)
tree6a66cbd00dbefb98febc214b849b235ec91d0131 /fs/f2fs/segment.h
parentf455c8a5f0a24090e99249eb7280012376adec2c (diff)
downloadlinux-2040fce83fe17763b07c97c1f691da2bb85e4135.tar.gz
linux-2040fce83fe17763b07c97c1f691da2bb85e4135.tar.bz2
linux-2040fce83fe17763b07c97c1f691da2bb85e4135.zip
f2fs: detect wrong layout
Previous mkfs.f2fs allows small partition inappropriately, so f2fs should detect that as well. Refer this in f2fs-tools. mkfs.f2fs: detect small partition by overprovision ratio and # of segments Reported-and-Tested-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/segment.h')
-rw-r--r--fs/f2fs/segment.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h
index 89ab4301ef02..9d44ce83acb2 100644
--- a/fs/f2fs/segment.h
+++ b/fs/f2fs/segment.h
@@ -18,6 +18,8 @@
#define DEF_RECLAIM_PREFREE_SEGMENTS 5 /* 5% over total segments */
#define DEF_MAX_RECLAIM_PREFREE_SEGMENTS 4096 /* 8GB in maximum */
+#define F2FS_MIN_SEGMENTS 9 /* SB + 2 (CP + SIT + NAT) + SSA + MAIN */
+
/* L: Logical segment # in volume, R: Relative segment # in main area */
#define GET_L2R_SEGNO(free_i, segno) (segno - free_i->start_segno)
#define GET_R2L_SEGNO(free_i, segno) (segno + free_i->start_segno)