erofs-utils: mkfs: update compressor status
Subsystems (3)
PATCH 1/3 erofs-utils: mkfs: update compressor status
- Promote DEFLATE compressors from EXPERIMENTAL status;
- Recommend using -E48bit with Zstandard compression since it doesn't support native fixed-size output compression (this feature has been requested for many years), thus the traditional unaligned compression has to be used. Note that further build-time optimizations together with -E48bit,fragments for Zstandard are still pending; it will be addressed in the next versions.
Signed-off-by Gao Xiang <[email protected]>
--- lib/compressor_deflate.c | 8 -------- lib/compressor_libdeflate.c | 3 --- lib/compressor_libzstd.c | 3 +-- 3 files changed, 1 insertion(+), 13 deletions(-)
lib/compressor_deflate.c +0 -8
@@ -37,8 +37,6 @@ static int compressor_deflate_exit(struct erofs_compress *c)static int compressor_deflate_init (struct erofs_compress *c) { -static erofs_atomic_bool_t __warnonce; -if (c->private_data) {kite_deflate_end (c->private_data); c->private_data =NULL ;
@@ -46,12 +44,6 @@ static int compressor_deflate_init(struct erofs_compress *c) c->private_data =kite_deflate_init (c->compression_level, c->dict_size);if (IS_ERR_VALUE (c->private_data))return PTR_ERR (c->private_data); - -if (!erofs_atomic_test_and_set (&__warnonce)) { -erofs_warn ("EXPERIMENTAL DEFLATE algorithm in use. Use at your own risk!" ); -erofs_warn ("*Carefully* check filesystem data correctness to avoid corruption!" ); -erofs_warn ("Please send a report to <[email protected]> if something is wrong." ); - }return 0 ; }
lib/compressor_libdeflate.c +0 -3
@@ -120,7 +120,6 @@ static int compressor_libdeflate_exit(struct erofs_compress *c)static int compressor_libdeflate_init (struct erofs_compress *c) { -static erofs_atomic_bool_t __warnonce;struct erofs_libdeflate_context *ctx;DBG_BUGON (c->private_data);
@@ -133,8 +132,6 @@ static int compressor_libdeflate_init(struct erofs_compress *c)return -ENOMEM ; } c->private_data = ctx; -if (!erofs_atomic_test_and_set (&__warnonce)) -erofs_warn ("EXPERIMENTAL libdeflate compressor in use. Use at your own risk!" );return 0 ; }
lib/compressor_libzstd.c +1 -2
@@ -175,8 +175,7 @@ static int compressor_libzstd_init(struct erofs_compress *c)if (!erofs_atomic_test_and_set (&__warnonce)) {erofs_warn ("EXPERIMENTAL libzstd compressor in use. Note that `fitblk` isn't supported by upstream zstd for now." ); -erofs_warn ("Therefore it will takes more time in order to get the optimal result." ); -erofs_info ("You could clarify further needs in zstd repository <https://github.com/facebook/zstd/issues> for reference too." ); +erofs_warn ("If unaligned compression isn't used (without -E48bit), it will take more time in order to get the optimal result." ); }return 0 ; out_err:
Signature · 1 line
2.43.5
PATCH 2/3 erofs-utils: switch on-disk header `erofs_fs.h` to MIT license
Source kernel commit: 0bdbf89a8bbeb155644b69dc2d071a1ce23414f8
[ Also align with the latest kernel `erofs_fs.h`. ]
Signed-off-by Gao Xiang <[email protected]>
--- LICENSES/MIT | 30 ++++++++++++++++++++++++++++++ dump/main.c | 2 +- include/erofs/internal.h | 2 +- include/erofs_fs.h | 27 ++++++++++++++------------- mkfs/main.c | 2 +- 5 files changed, 47 insertions(+), 16 deletions(-) create mode 100644 LICENSES/MIT
LICENSES/MIT new file +30 -0
@@ -0,0 +1,30 @@ +Valid-License-Identifier: MIT +SPDX-URL: https://spdx.org/licenses/MIT.html +Usage-Guide: + To use the MIT License put the following SPDX tag/value pair into a + comment according to the placement guidelines in the licensing rules + documentation: + SPDX-License-Identifier: MIT +License-Text: + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE.
dump/main.c +1 -1
@@ -96,7 +96,7 @@ static struct erofsdump_feature feature_lists[] = { { true, 0, EROFS_FEATURE_COMPAT_SB_CHKSUM, "sb_csum" }, { true, 0, EROFS_FEATURE_COMPAT_MTIME, "mtime" }, { true, 0, EROFS_FEATURE_COMPAT_XATTR_FILTER, "xattr_filter" }, - { false, 504U, EROFS_FEATURE_INCOMPAT_ZERO_PADDING, "0padding" }, + { false, 504U, EROFS_FEATURE_INCOMPAT_LZ4_0PADDING, "lz4_0padding" }, { false, 513U, EROFS_FEATURE_INCOMPAT_COMPR_CFGS, "compr_cfgs" }, { false, 513U, EROFS_FEATURE_INCOMPAT_BIG_PCLUSTER, "big_pcluster" }, { false, 515U, EROFS_FEATURE_INCOMPAT_CHUNKED_FILE, "chunked_file" },
include/erofs/internal.h +1 -1
@@ -179,7 +179,7 @@ static inline void erofs_sb_clear_##name(struct erofs_sb_info *sbi) \ sbi->feature_##compat &= ~EROFS_FEATURE_##feature; \ } -EROFS_FEATURE_FUNCS(lz4_0padding, incompat, INCOMPAT_ZERO_PADDING) +EROFS_FEATURE_FUNCS(lz4_0padding, incompat, INCOMPAT_LZ4_0PADDING) EROFS_FEATURE_FUNCS(compr_cfgs, incompat, INCOMPAT_COMPR_CFGS) EROFS_FEATURE_FUNCS(big_pcluster, incompat, INCOMPAT_BIG_PCLUSTER)EROFS_FEATURE_FUNCS (chunked_file, incompat,INCOMPAT_CHUNKED_FILE )
include/erofs_fs.h +14 -13
@@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-2.0-only OR Apache-2.0 */ +/* SPDX-License-Identifier: MIT */ /* * EROFS (Enhanced ROM File System) on-disk format definition *
@@ -13,17 +13,18 @@/* to allow for x86 boot sectors and other oddities. */ #define EROFS_SUPER_OFFSET 1024 -#define EROFS_FEATURE_COMPAT_SB_CHKSUM 0x00000001 -#define EROFS_FEATURE_COMPAT_MTIME 0x00000002 -#define EROFS_FEATURE_COMPAT_XATTR_FILTER 0x00000004 -#define EROFS_FEATURE_COMPAT_PLAIN_XATTR_PFX 0x00000010 -#define EROFS_FEATURE_COMPAT_ISHARE_XATTRS 0x00000020 +#define EROFS_FEATURE_COMPAT_SB_CHKSUM 0x00000001 +#define EROFS_FEATURE_COMPAT_MTIME 0x00000002 +#define EROFS_FEATURE_COMPAT_XATTR_FILTER 0x00000004 +#define EROFS_FEATURE_COMPAT_SHARED_EA_IN_METABOX 0x00000008 +#define EROFS_FEATURE_COMPAT_PLAIN_XATTR_PFX 0x00000010 +#define EROFS_FEATURE_COMPAT_ISHARE_XATTRS 0x00000020/* * Any bits that aren't in EROFS_ALL_FEATURE_INCOMPAT should * be incompatible with this kernel version. */ -#define EROFS_FEATURE_INCOMPAT_ZERO_PADDING 0x00000001 +#define EROFS_FEATURE_INCOMPAT_LZ4_0PADDING 0x00000001#define EROFS_FEATURE_INCOMPAT_COMPR_CFGS 0x00000002#define EROFS_FEATURE_INCOMPAT_BIG_PCLUSTER 0x00000002#define EROFS_FEATURE_INCOMPAT_CHUNKED_FILE 0x00000004
@@ -50,7 +51,7 @@ struct erofs_deviceslot { };#define EROFS_DEVT_SLOT_SIZE sizeof(struct erofs_deviceslot) -/* erofs on-disk super block (currently 128 bytes) */ +/* erofs on-disk super block (currently 144 bytes at maximum) */ struct erofs_super_block {__le32 magic;/* file system magic number */ __le32 checksum;/* crc32c to avoid unexpected on-disk overlap */
@@ -60,7 +61,7 @@ struct erofs_super_block {union {__le16 rootnid_2b;/* nid of root directory */ __le16 blocks_hi;/* (48BIT on) blocks count MSB */ - } rb; + } __packed rb;__le64 inos;/* total valid ino # (== f_files - f_favail) */ __le64 epoch;/* base seconds used for compact inodes */ __le32 fixed_nsec;/* fixed nanoseconds for compact inodes */
@@ -89,7 +90,7 @@ struct erofs_super_block {__le64 rootnid_8b;/* (48BIT on) nid of root directory */ __le64 reserved2;__le64 metabox_nid;/* (METABOX on) nid of the metabox inode */ -__le64 reserved3; +__le64 reserved3;/* [align to extslot 1] */ };/*
@@ -155,7 +156,7 @@ union erofs_inode_i_nb {__le16 nlink;/* if EROFS_I_NLINK_1_BIT is unset */ __le16 blocks_hi;/* total blocks count MSB */ __le16 startblk_hi;/* starting block number MSB */ -}; +} __packed;/* 32-byte reduced form of an ondisk inode */ struct erofs_inode_compact {
@@ -386,9 +387,9 @@ struct z_erofs_map_header {* bit 7 : pack the whole file into packed inode */ __u8 h_clusterbits; - }; + } __packed;__le16 h_extents_hi;/* extent count MSB */ - }; + } __packed; };enum {
mkfs/main.c +1 -1
@@ -1678,7 +1678,7 @@ static void erofs_mkfs_default_options(struct erofs_importer_params *params) mkfs_blkszbits =ilog2 (min_t (u32,getpagesize (),EROFS_MAX_BLOCK_SIZE )); params->pclusterblks_max =1U ; params->pclusterblks_def =1U ; - g_sbi.feature_incompat =EROFS_FEATURE_INCOMPAT_ZERO_PADDING ; + g_sbi.feature_incompat =EROFS_FEATURE_INCOMPAT_LZ4_0PADDING ; g_sbi.feature_compat =EROFS_FEATURE_COMPAT_SB_CHKSUM |EROFS_FEATURE_COMPAT_MTIME ; }
Signature · 1 line
2.43.5
PATCH 3/3 erofs-utils: mark 48bit and metabox as EXPERIMENTAL
In reply to Gao XiangKeep in sync with the latest 7.0-rc kernel.
Signed-off-by Gao Xiang <[email protected]>
--- lib/super.c | 6 ++++++ 1 file changed, 6 insertions(+)
lib/super.c +6 -0
@@ -169,6 +169,12 @@ int erofs_read_superblock(struct erofs_sb_info *sbi) sbi->devs =NULL ; } sbi->sb_valid = !ret; +if (erofs_sb_has_48bit (sbi)) +erofs_info ("EXPERIMENTAL 48-bit layout support in use. Use at your own risk!" ); +if (erofs_sb_has_metabox (sbi)) { +erofs_info ("EXPERIMENTAL metadata compression support in use. Use at your own risk!" ); +erofs_info ("No in-memory cache for metadata compression: userspace parser for metabox remains slow." ); + }return ret; }
Signature · 1 line
2.43.5