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@google.com>
Link: https://lore.kernel.org/r/20230830231606.3783734-2-dhavale@google.com
[ Gao Xiang: compare with EROFS_MAX_BLOCK_SIZE for safety. ]
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
cfg.c_showprogress = true;
cfg.c_legacy_compress = false;
cfg.c_xattr_name_filter = true;
- sbi.blkszbits = ilog2(EROFS_MAX_BLOCK_SIZE);
+ sbi.blkszbits = ilog2(min_t(u32, getpagesize(), EROFS_MAX_BLOCK_SIZE));
sbi.feature_incompat = EROFS_FEATURE_INCOMPAT_ZERO_PADDING;
sbi.feature_compat = EROFS_FEATURE_COMPAT_SB_CHKSUM |
EROFS_FEATURE_COMPAT_MTIME;