erofs-utils: mkfs: add ^{inline_data,ztailpacking,dedupe} options
PATCH 1/1 erofs-utils: mkfs: add ^{inline_data,ztailpacking,dedupe} options
Later, some preset configurations will be added, which could enable some of these features by default.
Let's add a way to turn each individual off too.
Signed-off-by Gao Xiang <[email protected]>
--- include/erofs/config.h | 2 +- lib/inode.c | 2 +- mkfs/main.c | 13 ++++++++++--- 3 files changed, 12 insertions(+), 5 deletions(-)
include/erofs/config.h +1 -1
@@ -45,7 +45,7 @@ struct erofs_configure {#endif char c_timeinherit;char c_chunkbits; -bool c_noinline_data; +bool c_inline_data;bool c_ztailpacking;bool c_fragments;bool c_all_fragments;
lib/inode.c +1 -1
@@ -657,7 +657,7 @@ static int erofs_prepare_inode_buffer(struct erofs_inode *inode) goto noinline;if (!is_inode_layout_compression (inode)) { -if (cfg.c_noinline_data &&S_ISREG (inode->i_mode)) { +if (!cfg.c_inline_data &&S_ISREG (inode->i_mode)) { inode->datalayout =EROFS_INODE_FLAT_PLAIN ; goto noinline; }
mkfs/main.c +10 -3
@@ -214,7 +214,13 @@ static int parse_extended_opts(const char *opts)if (MATCH_EXTENTED_OPT ("noinline_data" , token, keylen)) {if (vallen)return -EINVAL ; - cfg.c_noinline_data = true; + cfg.c_inline_data = false; + } + +if (MATCH_EXTENTED_OPT ("inline_data" , token, keylen)) { +if (vallen) +return -EINVAL ; + cfg.c_inline_data = !clear; }if (MATCH_EXTENTED_OPT ("force-inode-blockmap" , token, keylen)) {
@@ -232,7 +238,7 @@ static int parse_extended_opts(const char *opts)if (MATCH_EXTENTED_OPT ("ztailpacking" , token, keylen)) {if (vallen)return -EINVAL ; - cfg.c_ztailpacking = true; + cfg.c_ztailpacking = !clear; }if (MATCH_EXTENTED_OPT ("all-fragments" , token, keylen)) {
@@ -260,7 +266,7 @@ handle_fragment:if (MATCH_EXTENTED_OPT ("dedupe" , token, keylen)) {if (vallen)return -EINVAL ; - cfg.c_dedupe = true; + cfg.c_dedupe = !clear; }if (MATCH_EXTENTED_OPT ("xattr-name-filter" , token, keylen)) {
@@ -773,6 +779,7 @@ static void erofs_mkfs_default_options(void) { cfg.c_showprogress = true; cfg.c_legacy_compress = false; + cfg.c_inline_data = true; cfg.c_xattr_name_filter = true; sbi.blkszbits =ilog2 (min_t (u32,getpagesize (),EROFS_MAX_BLOCK_SIZE )); sbi.feature_incompat =EROFS_FEATURE_INCOMPAT_ZERO_PADDING ;
Signature · 1 line
2.39.3