diff options
author | Nick Terrell <terrelln@fb.com> | 2017-09-08 13:29:23 -0700 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2017-09-25 15:17:13 +0200 |
commit | 717a8b1e5d1ba69154ef84b35be75c9cf7730e1d (patch) | |
tree | 0f8d0e15f92171dc4cd7ed23ec789f50b83d486c /cmds-filesystem.c | |
parent | 86529862e1ff1b1b27aafc207b75b0c851fbfd34 (diff) |
btrfs-progs: Add zstd support
Adds zstd support to the btrfs program. An optional dependency on libzstd
>= 1.0.0 is added. Autoconf accepts `--enable-zstd' or `--disable-zstd' and
defaults to detecting if libzstd is present using `pkg-config'.
The patch is also available in my fork of btrfs-progs [1], which passes
Travis-CI with the new tests. The prebuilt binary is available there.
I haven't updated Android.mk.
[1] https://github.com/terrelln/btrfs-progs/tree/devel
Signed-off-by: Nick Terrell <terrelln@fb.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'cmds-filesystem.c')
-rw-r--r-- | cmds-filesystem.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/cmds-filesystem.c b/cmds-filesystem.c index 018857c8..dec0f26b 100644 --- a/cmds-filesystem.c +++ b/cmds-filesystem.c @@ -952,6 +952,8 @@ static int parse_compress_type(char *s) return BTRFS_COMPRESS_ZLIB; else if (strcmp(optarg, "lzo") == 0) return BTRFS_COMPRESS_LZO; + else if (strcmp(optarg, "zstd") == 0) + return BTRFS_COMPRESS_ZSTD; else { error("unknown compression type %s", s); exit(1); @@ -962,13 +964,13 @@ static const char * const cmd_filesystem_defrag_usage[] = { "btrfs filesystem defragment [options] <file>|<dir> [<file>|<dir>...]", "Defragment a file or a directory", "", - "-v be verbose", - "-r defragment files recursively", - "-c[zlib,lzo] compress the file while defragmenting", - "-f flush data to disk immediately after defragmenting", - "-s start defragment only from byte onward", - "-l len defragment only up to len bytes", - "-t size target extent size hint (default: 32M)", + "-v be verbose", + "-r defragment files recursively", + "-c[zlib,lzo,zstd] compress the file while defragmenting", + "-f flush data to disk immediately after defragmenting", + "-s start defragment only from byte onward", + "-l len defragment only up to len bytes", + "-t size target extent size hint (default: 32M)", NULL }; |