[PATCH 2/4] erofs-utils: add per-sb block size

Gao Xiang hsiangkao at linux.alibaba.com
Tue Mar 14 14:38:12 AEDT 2023


Will be used for subpage blocksize support.

Signed-off-by: Gao Xiang <hsiangkao at linux.alibaba.com>
---
 include/erofs/internal.h | 1 +
 mkfs/main.c              | 1 +
 2 files changed, 2 insertions(+)

diff --git a/include/erofs/internal.h b/include/erofs/internal.h
index d4ae3b8..a031915 100644
--- a/include/erofs/internal.h
+++ b/include/erofs/internal.h
@@ -88,6 +88,7 @@ struct erofs_sb_info {
 	u32 build_time_nsec;
 
 	unsigned char islotbits;
+	unsigned char blkszbits;
 
 	/* what we really care is nid, rather than ino.. */
 	erofs_nid_t root_nid;
diff --git a/mkfs/main.c b/mkfs/main.c
index 8e5a421..be3d805 100644
--- a/mkfs/main.c
+++ b/mkfs/main.c
@@ -641,6 +641,7 @@ static void erofs_mkfs_default_options(void)
 {
 	cfg.c_showprogress = true;
 	cfg.c_legacy_compress = false;
+	sbi.blkszbits = ilog2(PAGE_SIZE);
 	sbi.feature_incompat = EROFS_FEATURE_INCOMPAT_LZ4_0PADDING;
 	sbi.feature_compat = EROFS_FEATURE_COMPAT_SB_CHKSUM |
 			     EROFS_FEATURE_COMPAT_MTIME;
-- 
2.24.4



More information about the Linux-erofs mailing list