path: root/cddl/contrib/opensolaris/cmd
diff options
authorAndriy Gapon <avg@FreeBSD.org>2019-09-17 13:58:15 +0000
committerAndriy Gapon <avg@FreeBSD.org>2019-09-17 13:58:15 +0000
commit496ba62c3692f9a2805d0a7da43c02f92f659cb2 (patch)
treea5ff7ff7c32e163c95df7ab1377d8ecaec7da615 /cddl/contrib/opensolaris/cmd
parent840fa0f86d6de5c7b45c37a69ae86e07795b2f2a (diff)
MFZoL: Add -vnP support to 'zfs send' for bookmarks
zfsonlinux/zfs@835db58592d7d947e5818eb7281882e2a46073e0 We have long supported estimating a size of an incremental stream from a snapshot. We should do the same for bookmarks as well. Obtained from: ZoL Author: loli10K <ezomori.nozomu@gmail.com> MFC after: 3 days
Notes: svn path=/head/; revision=352447
Diffstat (limited to 'cddl/contrib/opensolaris/cmd')
2 files changed, 27 insertions, 17 deletions
diff --git a/cddl/contrib/opensolaris/cmd/zfs/zfs.8 b/cddl/contrib/opensolaris/cmd/zfs/zfs.8
index 53c144d1db0e..84f13273af22 100644
--- a/cddl/contrib/opensolaris/cmd/zfs/zfs.8
+++ b/cddl/contrib/opensolaris/cmd/zfs/zfs.8
@@ -190,8 +190,8 @@
.Ar snapshot
.Cm send
-.Op Fl Lce
-.Op Fl i Ar snapshot Ns | Ns bookmark
+.Op Fl LPcenv
+.Op Fl i Ar snapshot Ns | Ns Ar bookmark
.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
.Cm send
@@ -2766,7 +2766,7 @@ on future versions of
.It Xo
.Cm send
-.Op Fl Lce
+.Op Fl LPcenv
.Op Fl i Ar snapshot Ns | Ns Ar bookmark
.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
@@ -2780,7 +2780,7 @@ stream generated from a filesystem or volume is received, the default snapshot
name will be
.Pq --head-- .
.Bl -tag -width indent
-.It Fl i Ar snapshot Ns | Ns bookmark
+.It Fl i Ar snapshot Ns | Ns Ar bookmark
Generate an incremental send stream.
The incremental source must be an earlier
snapshot in the destination's history.
@@ -2792,6 +2792,23 @@ specified as the last component of the name
If the incremental target is a clone, the incremental source can
be the origin snapshot, or an earlier snapshot in the origin's filesystem,
or the origin's origin, etc.
+.It Fl n, -dryrun
+Do a dry-run
+.Pq Qq No-op
+Do not generate any actual send data.
+This is useful in conjunction with the
+.Fl v
+.Fl P
+flags to determine what data will be sent.
+In this case, the verbose output will be written to standard output
+.Po contrast with a non-dry-run, where the stream is written to standard output
+and the verbose output goes to standard error
+.Pc .
+.It Fl v, -verbose
+Print verbose information about the stream package generated.
+This information includes a per-second report of how much data has been sent.
.It Fl L, -large-block
Generate a stream which may contain blocks larger than 128KB.
This flag
@@ -2808,6 +2825,8 @@ See
for details on ZFS feature flags and the
.Sy large_blocks
+.It Fl P, -parsable
+Print machine-parsable verbose information about the stream package generated.
.It Fl c, -compressed
Generate a more compact stream by using compressed WRITE records for blocks
which are compressed on disk and in memory (see the
diff --git a/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c b/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
index 232181a87345..65dd40e33316 100644
--- a/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
+++ b/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
@@ -3928,13 +3928,11 @@ zfs_do_send(int argc, char **argv)
if (strchr(argv[0], '@') == NULL ||
(fromname && strchr(fromname, '#') != NULL)) {
- enum lzc_send_flags lzc_flags = 0;
if (flags.replicate || flags.doall || flags.props ||
- flags.dedup || flags.dryrun || flags.verbose ||
- flags.progress) {
- (void) fprintf(stderr,
- gettext("Error: "
+ flags.dedup || (strchr(argv[0], '@') == NULL &&
+ (flags.dryrun || flags.verbose || flags.progress))) {
+ (void) fprintf(stderr, gettext("Error: "
"Unsupported flag with filesystem or bookmark.\n"));
return (1);
@@ -3943,13 +3941,6 @@ zfs_do_send(int argc, char **argv)
if (zhp == NULL)
return (1);
- if (flags.largeblock)
- if (flags.embed_data)
- lzc_flags |= LZC_SEND_FLAG_EMBED_DATA;
- if (flags.compress)
- lzc_flags |= LZC_SEND_FLAG_COMPRESS;
if (fromname != NULL &&
(fromname[0] == '#' || fromname[0] == '@')) {
@@ -3963,7 +3954,7 @@ zfs_do_send(int argc, char **argv)
(void) strlcat(frombuf, fromname, sizeof (frombuf));
fromname = frombuf;
- err = zfs_send_one(zhp, fromname, STDOUT_FILENO, lzc_flags);
+ err = zfs_send_one(zhp, fromname, STDOUT_FILENO, flags);
return (err != 0);