* [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
* Re: [PATCH] btrfs-progs: enable default zlib compression in btrfs-image
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
0 siblings, 1 reply; 3+ messages in thread
From: David Sterba @ 2022-02-18 14:25 UTC (permalink / raw)
To: Anthony Iliopoulos; +Cc: linux-btrfs
On Tue, Feb 15, 2022 at 06:12:13PM +0100, Anthony Iliopoulos wrote:
> The btrfs-image utility supports zlib compression natively, but it is
> disabled by default. Enable it at the zlib-defined default compression
> level (6).
Makes sense to me, I don't think that there's a reason why the dump
should not be compressed.
However this patch breaks the tests, there are several image dumps
with crated data for some test cases, so this needs to be adapted first.
I'm not yet sure what's the problem, will look into it and then apply
this patch. Thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] btrfs-progs: enable default zlib compression in btrfs-image
2022-02-18 14:25 ` David Sterba
@ 2022-02-18 19:19 ` Anthony Iliopoulos
0 siblings, 0 replies; 3+ messages in thread
From: Anthony Iliopoulos @ 2022-02-18 19:19 UTC (permalink / raw)
To: dsterba, linux-btrfs
On Fri, Feb 18, 2022 at 03:25:33PM +0100, David Sterba wrote:
> On Tue, Feb 15, 2022 at 06:12:13PM +0100, Anthony Iliopoulos wrote:
> > The btrfs-image utility supports zlib compression natively, but it is
> > disabled by default. Enable it at the zlib-defined default compression
> > level (6).
>
> Makes sense to me, I don't think that there's a reason why the dump
> should not be compressed.
>
> However this patch breaks the tests, there are several image dumps
> with crated data for some test cases, so this needs to be adapted first.
That's actually my bad, the tests that do image restoration are failing
because of the options sanity checking as they find compress_level set
during restore. I'll send a v2 to fix this.
^ permalink raw reply [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