aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/zstream/zstream.c
diff options
context:
space:
mode:
authorPaul Dagnelie <[email protected]>2022-11-10 15:23:46 -0800
committerGitHub <[email protected]>2022-11-10 15:23:46 -0800
commit9f4ede63d23be4f43ba8dd0ca42c6a773a8eaa8d (patch)
tree88b62f576845104fb49b7f17af4172ff8c1dcd72 /cmd/zstream/zstream.c
parente9ab9e512c277ce3c22208599ebe5814db41a036 (diff)
Add ability to recompress send streams with new compression algorithm
As new compression algorithms are added to ZFS, it could be useful for people to recompress data with new algorithms. There is currently no mechanism to do this aside from copying the data manually into a new filesystem with the new algorithm enabled. This tool allows the transformation to happen through zfs send, allowing it to be done efficiently to remote systems and in an incremental fashion. A new zstream command is added that decompresses WRITE records and then recompresses them with a provided algorithm, and then re-emits the modified send stream. It may also be possible to re-compress embedded block pointers, but that was not attempted for the initial version. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Matthew Ahrens <[email protected]> Signed-off-by: Paul Dagnelie <[email protected]> Closes #14106
Diffstat (limited to 'cmd/zstream/zstream.c')
-rw-r--r--cmd/zstream/zstream.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/cmd/zstream/zstream.c b/cmd/zstream/zstream.c
index eeceba247..b1509c1f2 100644
--- a/cmd/zstream/zstream.c
+++ b/cmd/zstream/zstream.c
@@ -42,6 +42,8 @@ zstream_usage(void)
"\n"
"\tzstream decompress [-v] [OBJECT,OFFSET[,TYPE]] ...\n"
"\n"
+ "\tzstream recompress [ -l level] TYPE\n"
+ "\n"
"\tzstream token resume_token\n"
"\n"
"\tzstream redup [-v] FILE | ...\n");
@@ -65,6 +67,8 @@ main(int argc, char *argv[])
return (zstream_do_dump(argc - 1, argv + 1));
} else if (strcmp(subcommand, "decompress") == 0) {
return (zstream_do_decompress(argc - 1, argv + 1));
+ } else if (strcmp(subcommand, "recompress") == 0) {
+ return (zstream_do_recompress(argc - 1, argv + 1));
} else if (strcmp(subcommand, "token") == 0) {
return (zstream_do_token(argc - 1, argv + 1));
} else if (strcmp(subcommand, "redup") == 0) {