Index: contrib/opensolaris/cmd/zfs/zfs_main.c =================================================================== --- contrib/opensolaris/cmd/zfs/zfs_main.c (revision 199647) +++ contrib/opensolaris/cmd/zfs/zfs_main.c (working copy) @@ -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 @@ 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 @@ case 'n': flags.dryrun = B_TRUE; break; + case 'u': + flags.nomount = B_TRUE; + break; case 'v': flags.verbose = B_TRUE; break; Index: contrib/opensolaris/lib/libzfs/common/libzfs.h =================================================================== --- contrib/opensolaris/lib/libzfs/common/libzfs.h (revision 199647) +++ contrib/opensolaris/lib/libzfs/common/libzfs.h (working copy) @@ -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 @@ /* 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, Index: contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c =================================================================== --- contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c (revision 199647) +++ contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c (working copy) @@ -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 @@ 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;