[PATCH 4/4] erofs-utils: dump: add some superblock fields
Gao Xiang
hsiangkao at linux.alibaba.com
Fri Jun 9 19:40:52 AEST 2023
On 2023/6/9 16:50, Guo Xuenan via Linux-erofs wrote:
> dump.erofs show compression algorithms and sb_extslots,
> and update feature information.
>
> The proposed super block info is shown as below:
> Filesystem magic number: 0xE0F5E1E2
> Filesystem blocks: 4624
> Filesystem inode metadata start block: 0
> Filesystem shared xattr metadata start block: 0
> Filesystem root nid: 37
> Filesystem compr_algs: lz4, lz4hc, lzma
> Filesystem sb_extslots: 0
> Filesystem inode count: 6131
> Filesystem created: Wed Jun 7 17:15:44 2023
> Filesystem features: sb_csum mtime 0padding compr_cfgs big_pcluster
> Filesystem UUID: not available
>
> Signed-off-by: Guo Xuenan <guoxuenan at huawei.com>
> ---
> dump/main.c | 11 +++++++++++
> include/erofs/internal.h | 1 +
> lib/super.c | 5 +++++
> 3 files changed, 17 insertions(+)
>
> diff --git a/dump/main.c b/dump/main.c
> index ae1ffa0..2cb412d 100644
> --- a/dump/main.c
> +++ b/dump/main.c
> @@ -94,12 +94,14 @@ static struct erofsdump_feature feature_lists[] = {
> { true, EROFS_FEATURE_COMPAT_SB_CHKSUM, "sb_csum" },
> { true, EROFS_FEATURE_COMPAT_MTIME, "mtime" },
> { false, EROFS_FEATURE_INCOMPAT_ZERO_PADDING, "0padding" },
> + { false, EROFS_FEATURE_INCOMPAT_COMPR_CFGS, "compr_cfgs" },
> { false, EROFS_FEATURE_INCOMPAT_BIG_PCLUSTER, "big_pcluster" },
> { false, EROFS_FEATURE_INCOMPAT_CHUNKED_FILE, "chunked_file" },
> { false, EROFS_FEATURE_INCOMPAT_DEVICE_TABLE, "device_table" },
> { false, EROFS_FEATURE_INCOMPAT_ZTAILPACKING, "ztailpacking" },
> { false, EROFS_FEATURE_INCOMPAT_FRAGMENTS, "fragments" },
> { false, EROFS_FEATURE_INCOMPAT_DEDUPE, "dedupe" },
> + { false, EROFS_FEATURE_INCOMPAT_XATTR_PREFIXES, "xattr_prefixes" },
> };
>
> static int erofsdump_readdir(struct erofs_dir_context *ctx);
> @@ -609,6 +611,15 @@ static void erofsdump_show_superblock(void)
> if (erofs_sb_has_fragments() && sbi.packed_nid > 0)
> fprintf(stdout, "Filesystem packed nid: %llu\n",
> sbi.packed_nid | 0ULL);
> + if (erofs_sb_has_compr_cfgs()) {
> + fprintf(stdout, "Filesystem compr_algs: ");
> + zerofs_print_supported_compressors(stdout, sbi.available_compr_algs);
> + } else {
> + fprintf(stdout, "Filesystem lz4_max_dist: %u\n",
lz4_max_distance is better, let's keep the on-disk full name.
More information about the Linux-erofs
mailing list