Author: delphij
Date: Sun Jan  3 00:27:35 2010
New Revision: 201407
URL: http://svn.freebsd.org/changeset/base/201407

Log:
  MFC r200516:
  
  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

Modified:
  stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
  stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h
  stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
Directory Properties:
  stable/8/cddl/contrib/opensolaris/cmd/zfs/   (props changed)
  stable/8/cddl/contrib/opensolaris/lib/libzfs/   (props changed)

Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
==============================================================================
--- stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c        Sat Jan  2 
23:38:03 2010        (r201406)
+++ stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c        Sun Jan  3 
00:27:35 2010        (r201407)
@@ -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;

Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h
==============================================================================
--- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h        Sat Jan 
 2 23:38:03 2010        (r201406)
+++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h        Sun Jan 
 3 00:27:35 2010        (r201407)
@@ -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,

Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
==============================================================================
--- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c       
Sat Jan  2 23:38:03 2010        (r201406)
+++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c       
Sun Jan  3 00:27:35 2010        (r201407)
@@ -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 
 
        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;
 
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to