summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorLOLi <[email protected]>2017-09-09 00:24:31 +0200
committerBrian Behlendorf <[email protected]>2017-09-08 15:24:31 -0700
commit835db58592d7d947e5818eb7281882e2a46073e0 (patch)
tree5f99c47d3fa3ab2d18aeafb4b7be90975984f747 /cmd
parent57858fb5ca4b1d0f28b054cb5e15aaf3bc54c99e (diff)
Add -vnP support to 'zfs send' for bookmarks
This leverages the functionality introduced in cf7684b to expose verbose, dry-run and parsable 'zfs send' options for bookmarks. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: loli10K <[email protected]> Closes #3666 Closes #6601
Diffstat (limited to 'cmd')
-rw-r--r--cmd/zfs/zfs_main.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/cmd/zfs/zfs_main.c b/cmd/zfs/zfs_main.c
index be8389518..4331df403 100644
--- a/cmd/zfs/zfs_main.c
+++ b/cmd/zfs/zfs_main.c
@@ -3995,13 +3995,11 @@ zfs_do_send(int argc, char **argv)
if (strchr(argv[0], '@') == NULL ||
(fromname && strchr(fromname, '#') != NULL)) {
char frombuf[ZFS_MAX_DATASET_NAME_LEN];
- 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);
}
@@ -4010,15 +4008,6 @@ zfs_do_send(int argc, char **argv)
if (zhp == NULL)
return (1);
- if (flags.largeblock)
- lzc_flags |= LZC_SEND_FLAG_LARGE_BLOCK;
- if (flags.embed_data)
- lzc_flags |= LZC_SEND_FLAG_EMBED_DATA;
- if (flags.compress)
- lzc_flags |= LZC_SEND_FLAG_COMPRESS;
- if (flags.raw)
- lzc_flags |= LZC_SEND_FLAG_RAW;
-
if (fromname != NULL &&
(fromname[0] == '#' || fromname[0] == '@')) {
/*
@@ -4032,7 +4021,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);
zfs_close(zhp);
return (err != 0);
}