Deleted Added
full compact
libzfs_sendrecv.c (235951) libzfs_sendrecv.c (243674)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 7 unchanged lines hidden (view full) ---

16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22/*
23 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 7 unchanged lines hidden (view full) ---

16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22/*
23 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
24 * Copyright (c) 2011 by Delphix. All rights reserved.
24 * Copyright (c) 2012 by Delphix. All rights reserved.
25 * Copyright (c) 2012, Joyent, Inc. All rights reserved.
26 * Copyright (c) 2012 Pawel Jakub Dawidek <pawel@dawidek.net>.
27 * All rights reserved.
28 */
29
30#include <assert.h>
31#include <ctype.h>
32#include <errno.h>

--- 1349 unchanged lines hidden (view full) ---

1382{
1383 char errbuf[1024];
1384 send_dump_data_t sdd = { 0 };
1385 int err = 0;
1386 nvlist_t *fss = NULL;
1387 avl_tree_t *fsavl = NULL;
1388 static uint64_t holdseq;
1389 int spa_version;
25 * Copyright (c) 2012, Joyent, Inc. All rights reserved.
26 * Copyright (c) 2012 Pawel Jakub Dawidek <pawel@dawidek.net>.
27 * All rights reserved.
28 */
29
30#include <assert.h>
31#include <ctype.h>
32#include <errno.h>

--- 1349 unchanged lines hidden (view full) ---

1382{
1383 char errbuf[1024];
1384 send_dump_data_t sdd = { 0 };
1385 int err = 0;
1386 nvlist_t *fss = NULL;
1387 avl_tree_t *fsavl = NULL;
1388 static uint64_t holdseq;
1389 int spa_version;
1390 boolean_t holdsnaps = B_FALSE;
1391 pthread_t tid;
1392 int pipefd[2];
1393 dedup_arg_t dda = { 0 };
1394 int featureflags = 0;
1395
1396 (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN,
1397 "cannot send '%s'"), zhp->zfs_name);
1398

--- 6 unchanged lines hidden (view full) ---

1405 if (zhp->zfs_type == ZFS_TYPE_FILESYSTEM) {
1406 uint64_t version;
1407 version = zfs_prop_get_int(zhp, ZFS_PROP_VERSION);
1408 if (version >= ZPL_VERSION_SA) {
1409 featureflags |= DMU_BACKUP_FEATURE_SA_SPILL;
1410 }
1411 }
1412
1390 pthread_t tid;
1391 int pipefd[2];
1392 dedup_arg_t dda = { 0 };
1393 int featureflags = 0;
1394
1395 (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN,
1396 "cannot send '%s'"), zhp->zfs_name);
1397

--- 6 unchanged lines hidden (view full) ---

1404 if (zhp->zfs_type == ZFS_TYPE_FILESYSTEM) {
1405 uint64_t version;
1406 version = zfs_prop_get_int(zhp, ZFS_PROP_VERSION);
1407 if (version >= ZPL_VERSION_SA) {
1408 featureflags |= DMU_BACKUP_FEATURE_SA_SPILL;
1409 }
1410 }
1411
1413 if (!flags->dryrun && zfs_spa_version(zhp, &spa_version) == 0 &&
1414 spa_version >= SPA_VERSION_USERREFS &&
1415 (flags->doall || flags->replicate))
1416 holdsnaps = B_TRUE;
1417
1418 if (flags->dedup && !flags->dryrun) {
1419 featureflags |= (DMU_BACKUP_FEATURE_DEDUP |
1420 DMU_BACKUP_FEATURE_DEDUPPROPS);
1421 if (err = pipe(pipefd)) {
1422 zfs_error_aux(zhp->zfs_hdl, strerror(errno));
1423 return (zfs_error(zhp->zfs_hdl, EZFS_PIPEFAILED,
1424 errbuf));
1425 }

--- 105 unchanged lines hidden (view full) ---

1531 sdd.verbose = flags->verbose;
1532 sdd.parsable = flags->parsable;
1533 sdd.progress = flags->progress;
1534 sdd.dryrun = flags->dryrun;
1535 sdd.filter_cb = filter_func;
1536 sdd.filter_cb_arg = cb_arg;
1537 if (debugnvp)
1538 sdd.debugnv = *debugnvp;
1412 if (flags->dedup && !flags->dryrun) {
1413 featureflags |= (DMU_BACKUP_FEATURE_DEDUP |
1414 DMU_BACKUP_FEATURE_DEDUPPROPS);
1415 if (err = pipe(pipefd)) {
1416 zfs_error_aux(zhp->zfs_hdl, strerror(errno));
1417 return (zfs_error(zhp->zfs_hdl, EZFS_PIPEFAILED,
1418 errbuf));
1419 }

--- 105 unchanged lines hidden (view full) ---

1525 sdd.verbose = flags->verbose;
1526 sdd.parsable = flags->parsable;
1527 sdd.progress = flags->progress;
1528 sdd.dryrun = flags->dryrun;
1529 sdd.filter_cb = filter_func;
1530 sdd.filter_cb_arg = cb_arg;
1531 if (debugnvp)
1532 sdd.debugnv = *debugnvp;
1539 if (holdsnaps || flags->progress) {
1533
1534 /*
1535 * Some flags require that we place user holds on the datasets that are
1536 * being sent so they don't get destroyed during the send. We can skip
1537 * this step if the pool is imported read-only since the datasets cannot
1538 * be destroyed.
1539 */
1540 if (!flags->dryrun && !zpool_get_prop_int(zfs_get_pool_handle(zhp),
1541 ZPOOL_PROP_READONLY, NULL) &&
1542 zfs_spa_version(zhp, &spa_version) == 0 &&
1543 spa_version >= SPA_VERSION_USERREFS &&
1544 (flags->doall || flags->replicate)) {
1540 ++holdseq;
1541 (void) snprintf(sdd.holdtag, sizeof (sdd.holdtag),
1542 ".send-%d-%llu", getpid(), (u_longlong_t)holdseq);
1543 sdd.cleanup_fd = open(ZFS_DEV, O_RDWR|O_EXCL);
1544 if (sdd.cleanup_fd < 0) {
1545 err = errno;
1546 goto stderr_out;
1547 }

--- 1653 unchanged lines hidden ---
1545 ++holdseq;
1546 (void) snprintf(sdd.holdtag, sizeof (sdd.holdtag),
1547 ".send-%d-%llu", getpid(), (u_longlong_t)holdseq);
1548 sdd.cleanup_fd = open(ZFS_DEV, O_RDWR|O_EXCL);
1549 if (sdd.cleanup_fd < 0) {
1550 err = errno;
1551 goto stderr_out;
1552 }

--- 1653 unchanged lines hidden ---