summaryrefslogtreecommitdiffstats
path: root/cddl
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2009-12-14 17:04:44 +0000
committerdelphij <delphij@FreeBSD.org>2009-12-14 17:04:44 +0000
commitd9b88426fba41935b0de3e2ef4ab110241f60cd4 (patch)
treef3ef1bdde75344cef477690931252237a703368d /cddl
parentf86f4aa6c808bb49f5e5252a6054b0bd87088288 (diff)
downloadFreeBSD-src-d9b88426fba41935b0de3e2ef4ab110241f60cd4.zip
FreeBSD-src-d9b88426fba41935b0de3e2ef4ab110241f60cd4.tar.gz
Add an option to specify that the received ZFS should not be automatically
mounted (receive -u). Obtained from: OpenSolaris (onnv revision 8584:327a1b6dd944) Approved by: pjd
Diffstat (limited to 'cddl')
-rw-r--r--cddl/contrib/opensolaris/cmd/zfs/zfs_main.c7
-rw-r--r--cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h5
-rw-r--r--cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c4
3 files changed, 11 insertions, 5 deletions
diff --git a/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c b/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
index 6f5f92e..d6bc6e1 100644
--- a/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
+++ b/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
@@ -20,7 +20,7 @@
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -2457,7 +2457,7 @@ zfs_do_receive(int argc, char **argv)
bzero(&flags, sizeof (recvflags_t));
/* check options */
- while ((c = getopt(argc, argv, ":dnvF")) != -1) {
+ while ((c = getopt(argc, argv, ":dnuvF")) != -1) {
switch (c) {
case 'd':
flags.isprefix = B_TRUE;
@@ -2465,6 +2465,9 @@ zfs_do_receive(int argc, char **argv)
case 'n':
flags.dryrun = B_TRUE;
break;
+ case 'u':
+ flags.nomount = B_TRUE;
+ break;
case 'v':
flags.verbose = B_TRUE;
break;
diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h
index 4e8efb4..9a13bbb 100644
--- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h
+++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h
@@ -20,7 +20,7 @@
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -457,6 +457,9 @@ typedef struct recvflags {
/* byteswap flag is used internally; callers need not specify */
int byteswap : 1;
+
+ /* do not mount file systems as they are extracted (private) */
+ int nomount : 1;
} recvflags_t;
extern int zfs_receive(libzfs_handle_t *, const char *, recvflags_t,
diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
index 5ee17fb..3516f6d 100644
--- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
+++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
@@ -20,7 +20,7 @@
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -2080,7 +2080,7 @@ zfs_receive(libzfs_handle_t *hdl, const char *tosnap, recvflags_t flags,
err = zfs_receive_impl(hdl, tosnap, flags, infd, stream_avl, &top_zfs);
- if (err == 0 && top_zfs) {
+ if (err == 0 && !flags.nomount && top_zfs) {
zfs_handle_t *zhp;
prop_changelist_t *clp;
OpenPOWER on IntegriCloud