Skip to content

Commit

Permalink
OpenZFS 7252 - compressed zfs send / receive
Browse files Browse the repository at this point in the history
OpenZFS 7252 - compressed zfs send / receive
OpenZFS 7628 - create long versions of ZFS send / receive options

Authored by: Dan Kimmel <[email protected]>
Reviewed by: George Wilson <[email protected]>
Reviewed by: John Kennedy <[email protected]>
Reviewed by: Matthew Ahrens <[email protected]>
Reviewed by: Paul Dagnelie <[email protected]>
Reviewed by: Pavel Zakharov <[email protected]>
Reviewed by: Sebastien Roy <[email protected]>
Reviewed by: David Quigley <[email protected]>
Reviewed by: Thomas Caputi <[email protected]>
Approved by: Dan McDonald <[email protected]>
Reviewed by: David Quigley <[email protected]>
Reviewed-by: loli10K <[email protected]>
Ported-by: bunder2015 <[email protected]>
Ported-by: Don Brady <[email protected]>
Ported-by: Brian Behlendorf <[email protected]>

Porting Notes:
- Most of 7252 was already picked up during ABD work.  This
  commit represents the gap from the final commit to openzfs.
- Fixed split_large_blocks check in do_dump()
- An alternate version of the write_compressible() function was
  implemented for Linux which does not depend on fio.  The behavior
  of fio differs significantly based on the exact version.
- mkholes was replaced with truncate for Linux.

OpenZFS-issue: https://www.illumos.org/issues/7252
OpenZFS-commit: openzfs/openzfs@5602294
Closes #6067
  • Loading branch information
dankimmel authored and behlendorf committed Apr 26, 2017
1 parent 7a25f08 commit a700472
Show file tree
Hide file tree
Showing 41 changed files with 1,668 additions and 104 deletions.
18 changes: 17 additions & 1 deletion cmd/zfs/zfs_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <getopt.h>
#include <libgen.h>
#include <libintl.h>
#include <libuutil.h>
Expand Down Expand Up @@ -3771,8 +3772,23 @@ zfs_do_send(int argc, char **argv)
nvlist_t *dbgnv = NULL;
boolean_t extraverbose = B_FALSE;

struct option long_options[] = {
{"replicate", no_argument, NULL, 'R'},
{"props", no_argument, NULL, 'p'},
{"parsable", no_argument, NULL, 'P'},
{"dedup", no_argument, NULL, 'D'},
{"verbose", no_argument, NULL, 'v'},
{"dryrun", no_argument, NULL, 'n'},
{"large-block", no_argument, NULL, 'L'},
{"embed", no_argument, NULL, 'e'},
{"resume", required_argument, NULL, 't'},
{"compressed", no_argument, NULL, 'c'},
{0, 0, 0, 0}
};

/* check options */
while ((c = getopt(argc, argv, ":i:I:RDpvnPLet:c")) != -1) {
while ((c = getopt_long(argc, argv, ":i:I:RDpvnPLet:c", long_options,
NULL)) != -1) {
switch (c) {
case 'i':
if (fromname)
Expand Down
4 changes: 2 additions & 2 deletions cmd/zstreamdump/zstreamdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,8 +430,8 @@ main(int argc, char *argv[])
drro->drr_bonuslen);
}
if (drro->drr_bonuslen > 0) {
(void) ssread(buf, P2ROUNDUP(drro->drr_bonuslen,
8), &zc);
(void) ssread(buf,
P2ROUNDUP(drro->drr_bonuslen, 8), &zc);
if (dump) {
print_block(buf,
P2ROUNDUP(drro->drr_bonuslen, 8));
Expand Down
4 changes: 2 additions & 2 deletions lib/libzfs_core/libzfs_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,10 +493,10 @@ lzc_send_resume(const char *snapname, const char *from, int fd,
fnvlist_add_string(args, "fromsnap", from);
if (flags & LZC_SEND_FLAG_LARGE_BLOCK)
fnvlist_add_boolean(args, "largeblockok");
if (flags & LZC_SEND_FLAG_COMPRESS)
fnvlist_add_boolean(args, "compressok");
if (flags & LZC_SEND_FLAG_EMBED_DATA)
fnvlist_add_boolean(args, "embedok");
if (flags & LZC_SEND_FLAG_COMPRESS)
fnvlist_add_boolean(args, "compressok");
if (resumeobj != 0 || resumeoff != 0) {
fnvlist_add_uint64(args, "resume_object", resumeobj);
fnvlist_add_uint64(args, "resume_offset", resumeoff);
Expand Down
20 changes: 10 additions & 10 deletions man/man8/zfs.8
Original file line number Diff line number Diff line change
Expand Up @@ -2755,7 +2755,7 @@ Generate a stream package that sends all intermediary snapshots from the first s
.sp
.ne 2
.na
\fB\fB-R\fR\fR
\fB\fB-R\fR, \fB--replicate\fR\fR
.ad
.sp .6
.RS 4n
Expand All @@ -2767,7 +2767,7 @@ If the \fB-i\fR or \fB-I\fR flags are used in conjunction with the \fB-R\fR flag
.sp
.ne 2
.na
\fB\fB-D\fR\fR
\fB\fB-D\fR, \fB--dedup\fR\fR
.ad
.sp .6
.RS 4n
Expand All @@ -2777,7 +2777,7 @@ Generate a deduplicated stream. Blocks which would have been sent multiple times
.sp
.ne 2
.na
\fB\fB-L\fR\fR
\fB\fB-L\fR, \fB--large-block\fR\fR
.ad
.sp .6
.RS 4n
Expand All @@ -2792,7 +2792,7 @@ flags and the \fBlarge_blocks\fR feature.
.sp
.ne 2
.na
\fB\fB-e\fR\fR
\fB\fB-e\fR, \fB--embed\fR\fR
.ad
.sp .6
.RS 4n
Expand Down Expand Up @@ -2825,7 +2825,7 @@ decompressed before sending so it can be split into smaller block sizes.
.sp
.ne 2
.na
\fB\fB-p\fR\fR
\fB\fB-p\fR, \fB--props\fR\fR
.ad
.sp .6
.RS 4n
Expand All @@ -2835,7 +2835,7 @@ Include the dataset's properties in the stream. This flag is implicit when -R i
.sp
.ne 2
.na
\fB\fB-n\fR\fR
\fB\fB-n\fR, \fB--dryrun\fR\fR
.ad
.sp .6
.RS 4n
Expand All @@ -2849,7 +2849,7 @@ to standard output and the verbose output goes to standard error).
.sp
.ne 2
.na
\fB\fB-P\fR\fR
\fB\fB-P\fR, \fB--parsable\fR\fR
.ad
.sp .6
.RS 4n
Expand All @@ -2859,7 +2859,7 @@ Print machine-parsable verbose information about the stream package generated.
.sp
.ne 2
.na
\fB\fB-v\fR\fR
\fB\fB-v\fR, \fB--verbose\fR\fR
.ad
.sp .6
.RS 4n
Expand Down Expand Up @@ -2887,7 +2887,7 @@ name will be "--head--".
.sp
.ne 2
.na
\fB\fB-L\fR\fR
\fB\fB-L\fR, \fB--large-block\fR\fR
.ad
.sp .6
.RS 4n
Expand All @@ -2902,7 +2902,7 @@ flags and the \fBlarge_blocks\fR feature.
.sp
.ne 2
.na
\fB\fB-e\fR\fR
\fB\fB-e\fR, \fB--embed\fR\fR
.ad
.sp .6
.RS 4n
Expand Down
Loading

0 comments on commit a700472

Please sign in to comment.