public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs-progs: enable default zlib compression in btrfs-image
@ 2022-02-15 17:12 Anthony Iliopoulos
  2022-02-18 14:25 ` David Sterba
  0 siblings, 1 reply; 3+ messages in thread
From: Anthony Iliopoulos @ 2022-02-15 17:12 UTC (permalink / raw)
  To: linux-btrfs

The btrfs-image utility supports zlib compression natively, but it is
disabled by default. Enable it at the zlib-defined default compression
level (6).

Signed-off-by: Anthony Iliopoulos <ailiop@suse.com>
---
 Documentation/btrfs-image.asciidoc | 2 +-
 Documentation/btrfs-image.rst      | 2 +-
 image/main.c                       | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Documentation/btrfs-image.asciidoc b/Documentation/btrfs-image.asciidoc
index 382651712bef..fa3647a5bc05 100644
--- a/Documentation/btrfs-image.asciidoc
+++ b/Documentation/btrfs-image.asciidoc
@@ -30,7 +30,7 @@ restored by running tree log reply if possible. To restore without
 changing number of stripes in chunk tree check -o option.
 
 -c <value>::
-Compression level (0 ~ 9).
+Compression level (0 ~ 9). Defaults to zlib level 6.
 
 -t <value>::
 Number of threads (1 ~ 32) to be used to process the image dump or restore.
diff --git a/Documentation/btrfs-image.rst b/Documentation/btrfs-image.rst
index a7b200c1e7f9..67f4e7d49618 100644
--- a/Documentation/btrfs-image.rst
+++ b/Documentation/btrfs-image.rst
@@ -27,7 +27,7 @@ OPTIONS
         changing number of stripes in chunk tree check *-o* option.
 
 -c <value>
-        Compression level (0 ~ 9).
+        Compression level (0 ~ 9). Defaults to zlib level 6.
 
 -t <value>
         Number of threads (1 ~ 32) to be used to process the image dump or restore.
diff --git a/image/main.c b/image/main.c
index 3125163d1bfc..cbdf619d0b8c 100644
--- a/image/main.c
+++ b/image/main.c
@@ -3050,7 +3050,7 @@ int BOX_MAIN(image)(int argc, char *argv[])
 	char *source;
 	char *target;
 	u64 num_threads = 0;
-	u64 compress_level = 0;
+	u64 compress_level = 6;
 	int create = 1;
 	int old_restore = 0;
 	int walk_trees = 0;
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-18 19:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-15 17:12 [PATCH] btrfs-progs: enable default zlib compression in btrfs-image Anthony Iliopoulos
2022-02-18 14:25 ` David Sterba
2022-02-18 19:19   ` Anthony Iliopoulos

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox