[PATCH v1 2/2] erofs-utils: Set mkfs default blocksize based on current platform

Sandeep Dhavale dhavale at google.com
Thu Aug 31 09:16:06 AEST 2023


Set mkfs default blocksize to current platform pagesize.
This means mkfs with default options will work on current
platform. If we are building image for a platform for a different
blocksize, we can override default with -b option up to
EROFS_MAX_BLOCK_SIZE.

Signed-off-by: Sandeep Dhavale <dhavale at google.com>
---
 mkfs/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mkfs/main.c b/mkfs/main.c
index 37bf658..8c2c2e3 100644
--- a/mkfs/main.c
+++ b/mkfs/main.c
@@ -689,7 +689,7 @@ static void erofs_mkfs_default_options(void)
 {
 	cfg.c_showprogress = true;
 	cfg.c_legacy_compress = false;
-	sbi.blkszbits = ilog2(EROFS_MAX_BLOCK_SIZE);
+	sbi.blkszbits = ilog2(getpagesize());
 	sbi.feature_incompat = EROFS_FEATURE_INCOMPAT_ZERO_PADDING;
 	sbi.feature_compat = EROFS_FEATURE_COMPAT_SB_CHKSUM |
 			     EROFS_FEATURE_COMPAT_MTIME;
-- 
2.42.0.283.g2d96d420d3-goog



More information about the Linux-erofs mailing list