Deleted Added
full compact
libzfs_sendrecv.c (200516) libzfs_sendrecv.c (209962)
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

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

235{
236 nvpair_t *elem = NULL;
237
238 while ((elem = nvlist_next_nvpair(zhp->zfs_props, elem)) != NULL) {
239 char *propname = nvpair_name(elem);
240 zfs_prop_t prop = zfs_name_to_prop(propname);
241 nvlist_t *propnv;
242
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

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

235{
236 nvpair_t *elem = NULL;
237
238 while ((elem = nvlist_next_nvpair(zhp->zfs_props, elem)) != NULL) {
239 char *propname = nvpair_name(elem);
240 zfs_prop_t prop = zfs_name_to_prop(propname);
241 nvlist_t *propnv;
242
243 assert(zfs_prop_user(propname) || prop != ZPROP_INVAL);
244
243 if (!zfs_prop_user(propname) && zfs_prop_readonly(prop))
244 continue;
245
246 verify(nvpair_value_nvlist(elem, &propnv) == 0);
247 if (prop == ZFS_PROP_QUOTA || prop == ZFS_PROP_RESERVATION) {
248 /* these guys are modifyable, but have no source */
249 uint64_t value;
250 verify(nvlist_lookup_uint64(propnv,

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

591 if (!sdd->seenfrom) {
592 (void) fprintf(stderr,
593 "WARNING: could not send %s@%s:\n"
594 "incremental source (%s@%s) does not exist\n",
595 zhp->zfs_name, sdd->tosnap,
596 zhp->zfs_name, sdd->fromsnap);
597 sdd->err = B_TRUE;
598 } else if (!sdd->seento) {
245 if (!zfs_prop_user(propname) && zfs_prop_readonly(prop))
246 continue;
247
248 verify(nvpair_value_nvlist(elem, &propnv) == 0);
249 if (prop == ZFS_PROP_QUOTA || prop == ZFS_PROP_RESERVATION) {
250 /* these guys are modifyable, but have no source */
251 uint64_t value;
252 verify(nvlist_lookup_uint64(propnv,

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

593 if (!sdd->seenfrom) {
594 (void) fprintf(stderr,
595 "WARNING: could not send %s@%s:\n"
596 "incremental source (%s@%s) does not exist\n",
597 zhp->zfs_name, sdd->tosnap,
598 zhp->zfs_name, sdd->fromsnap);
599 sdd->err = B_TRUE;
600 } else if (!sdd->seento) {
599 (void) fprintf(stderr,
600 "WARNING: could not send %s@%s:\n"
601 "incremental source (%s@%s) "
602 "is not earlier than it\n",
603 zhp->zfs_name, sdd->tosnap,
604 zhp->zfs_name, sdd->fromsnap);
601 if (sdd->fromsnap) {
602 (void) fprintf(stderr,
603 "WARNING: could not send %s@%s:\n"
604 "incremental source (%s@%s) "
605 "is not earlier than it\n",
606 zhp->zfs_name, sdd->tosnap,
607 zhp->zfs_name, sdd->fromsnap);
608 } else {
609 (void) fprintf(stderr, "WARNING: "
610 "could not send %s@%s: does not exist\n",
611 zhp->zfs_name, sdd->tosnap);
612 }
605 sdd->err = B_TRUE;
606 }
607 } else {
608 zfs_handle_t *snapzhp;
609 char snapname[ZFS_MAXNAMELEN];
610
611 (void) snprintf(snapname, sizeof (snapname), "%s@%s",
612 zfs_get_name(zhp), sdd->tosnap);

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

1095{
1096 nvlist_t *local_nv;
1097 avl_tree_t *local_avl;
1098 nvpair_t *fselem, *nextfselem;
1099 char *tosnap, *fromsnap;
1100 char newname[ZFS_MAXNAMELEN];
1101 int error;
1102 boolean_t needagain, progress;
613 sdd->err = B_TRUE;
614 }
615 } else {
616 zfs_handle_t *snapzhp;
617 char snapname[ZFS_MAXNAMELEN];
618
619 (void) snprintf(snapname, sizeof (snapname), "%s@%s",
620 zfs_get_name(zhp), sdd->tosnap);

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

1103{
1104 nvlist_t *local_nv;
1105 avl_tree_t *local_avl;
1106 nvpair_t *fselem, *nextfselem;
1107 char *tosnap, *fromsnap;
1108 char newname[ZFS_MAXNAMELEN];
1109 int error;
1110 boolean_t needagain, progress;
1111 char *s1, *s2;
1103
1104 VERIFY(0 == nvlist_lookup_string(stream_nv, "fromsnap", &fromsnap));
1105 VERIFY(0 == nvlist_lookup_string(stream_nv, "tosnap", &tosnap));
1106
1107 if (flags.dryrun)
1108 return (0);
1109
1110again:

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

1289 continue;
1290 }
1291
1292 VERIFY(0 == nvlist_lookup_string(stream_nvfs,
1293 "name", &stream_fsname));
1294 VERIFY(0 == nvlist_lookup_uint64(stream_nvfs,
1295 "parentfromsnap", &stream_parent_fromsnap_guid));
1296
1112
1113 VERIFY(0 == nvlist_lookup_string(stream_nv, "fromsnap", &fromsnap));
1114 VERIFY(0 == nvlist_lookup_string(stream_nv, "tosnap", &tosnap));
1115
1116 if (flags.dryrun)
1117 return (0);
1118
1119again:

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

1298 continue;
1299 }
1300
1301 VERIFY(0 == nvlist_lookup_string(stream_nvfs,
1302 "name", &stream_fsname));
1303 VERIFY(0 == nvlist_lookup_uint64(stream_nvfs,
1304 "parentfromsnap", &stream_parent_fromsnap_guid));
1305
1306 s1 = strrchr(fsname, '/');
1307 s2 = strrchr(stream_fsname, '/');
1308
1297 /* check for rename */
1309 /* check for rename */
1298 p1 = strrchr(fsname, '/');
1299 p2 = strrchr(stream_fsname, '/');
1300 if ((stream_parent_fromsnap_guid != 0 &&
1301 stream_parent_fromsnap_guid != parent_fromsnap_guid) ||
1310 if ((stream_parent_fromsnap_guid != 0 &&
1311 stream_parent_fromsnap_guid != parent_fromsnap_guid) ||
1302 (p1 != NULL && p2 != NULL && strcmp (p1, p2) != 0)) {
1312 ((s1 != NULL) && (s2 != NULL) && strcmp(s1, s2) != 0)) {
1303 nvlist_t *parent;
1304 char tryname[ZFS_MAXNAMELEN];
1305
1306 parent = fsavl_find(local_avl,
1307 stream_parent_fromsnap_guid, NULL);
1308 /*
1309 * NB: parent might not be found if we used the
1310 * tosnap for stream_parent_fromsnap_guid,

--- 795 unchanged lines hidden ---
1313 nvlist_t *parent;
1314 char tryname[ZFS_MAXNAMELEN];
1315
1316 parent = fsavl_find(local_avl,
1317 stream_parent_fromsnap_guid, NULL);
1318 /*
1319 * NB: parent might not be found if we used the
1320 * tosnap for stream_parent_fromsnap_guid,

--- 795 unchanged lines hidden ---