[PATCH 2/4] erofs-utils: lib: unify all identical compressor print function
Gao Xiang
hsiangkao at linux.alibaba.com
Fri Jun 9 19:39:52 AEST 2023
On 2023/6/9 16:50, Guo Xuenan via Linux-erofs wrote:
> {dump,fsck}.erofs use the same compressor print function,
> available_compressors means which algothrims are currently
> supported by binary tools.
> supported_compressors including all algothrims that are ready
> for erofs.
>
> Signed-off-by: Guo Xuenan <guoxuenan at huawei.com>
> ---
> fsck/main.c | 15 +-----------
> include/erofs/compress.h | 3 ++-
> lib/compressor.c | 51 ++++++++++++++++++++++++++--------------
> mkfs/main.c | 15 +-----------
> 4 files changed, 38 insertions(+), 46 deletions(-)
>
> diff --git a/fsck/main.c b/fsck/main.c
> index f816bec..978d198 100644
> --- a/fsck/main.c
> +++ b/fsck/main.c
> @@ -49,19 +49,6 @@ static struct option long_options[] = {
> {0, 0, 0, 0},
> };
>
> -static void print_available_decompressors(FILE *f, const char *delim)
> -{
> - unsigned int i = 0;
> - const char *s;
> -
> - while ((s = z_erofs_list_available_compressors(i)) != NULL) {
> - if (i++)
> - fputs(delim, f);
> - fputs(s, f);
> - }
> - fputc('\n', f);
> -}
> -
> static void usage(void)
> {
> fputs("usage: [options] IMAGE\n\n"
> @@ -84,7 +71,7 @@ static void usage(void)
> " --no-preserve-owner extract as yourself\n"
> " --no-preserve-perms apply user's umask when extracting permissions\n"
> "\nSupported algorithms are: ", stderr);
> - print_available_decompressors(stderr, ", ");
> + zerofs_print_available_compressors(stderr);
It'd be better to keep z_erofs for compression side.
More information about the Linux-erofs
mailing list