Skip to content

Commit bf86e95

Browse files
committed
btrfs-progs: mkfs: print which compression algos are compiled in
The compression support is optional, eg. also in 'btrfs-restore', so print the support in help text. usage: mkfs.btrfs [options] <dev> [<dev...>] ... --compress ALGO[:LEVEL] compress files by algorithm and level, ALGO can be 'no' (default), zstd, lzo, zlib Built-in: - ZSTD: yes - LZO: yes - ZLIB: yes ... Signed-off-by: David Sterba <[email protected]>
1 parent 2bf30ba commit bf86e95

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

Diff for: Documentation/mkfs.btrfs.rst

+4
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,10 @@ OPTIONS
164164
they would be larger than the uncompressed versions, and will set file attribute
165165
*NOCOMPRESS* if its beginning is found to be incompressible.
166166

167+
.. note::
168+
The support for ZSTD and LZO is a compile-time option, please check
169+
the output of :command:`mkfs.btrfs --help` for the actual support.
170+
167171
-u|--subvol <type>:<subdir>
168172
Specify that *subdir* is to be created as a subvolume rather than a regular
169173
directory. The option *--rootdir* must also be specified, and *subdir* must be an

Diff for: mkfs/main.c

+12
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,18 @@ static const char * const mkfs_usage[] = {
442442
OPTLINE("-b|--byte-count SIZE", "set size of each device to SIZE (filesystem size is sum of all device sizes)"),
443443
OPTLINE("-r|--rootdir DIR", "copy files from DIR to the image root directory"),
444444
OPTLINE("--compress ALGO[:LEVEL]", "compress files by algorithm and level, ALGO can be 'no' (default), zstd, lzo, zlib"),
445+
OPTLINE("", "Built-in:"),
446+
#if COMPRESSION_ZSTD
447+
OPTLINE("", "- ZSTD: yes"),
448+
#else
449+
OPTLINE("", "- ZSTD: no"),
450+
#endif
451+
#if COMPRESSION_LZO
452+
OPTLINE("", "- LZO: yes"),
453+
#else
454+
OPTLINE("", "- LZO: no"),
455+
#endif
456+
OPTLINE("", "- ZLIB: yes"),
445457
OPTLINE("-u|--subvol TYPE:SUBDIR", "create SUBDIR as subvolume rather than normal directory, can be specified multiple times"),
446458
OPTLINE("--shrink", "(with --rootdir) shrink the filled filesystem to minimal size"),
447459
OPTLINE("-K|--nodiscard", "do not perform whole device TRIM"),

0 commit comments

Comments
 (0)