Deleted Added
full compact
libzfs_dataset.c (307050) libzfs_dataset.c (307105)
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

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

3450
3451/*
3452 * Destroys all the snapshots named in the nvlist.
3453 */
3454int
3455zfs_destroy_snaps_nvl(libzfs_handle_t *hdl, nvlist_t *snaps, boolean_t defer)
3456{
3457 int ret;
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

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

3450
3451/*
3452 * Destroys all the snapshots named in the nvlist.
3453 */
3454int
3455zfs_destroy_snaps_nvl(libzfs_handle_t *hdl, nvlist_t *snaps, boolean_t defer)
3456{
3457 int ret;
3458 nvlist_t *errlist;
3458 nvlist_t *errlist = NULL;
3459
3460 ret = lzc_destroy_snaps(snaps, defer, &errlist);
3461
3459
3460 ret = lzc_destroy_snaps(snaps, defer, &errlist);
3461
3462 if (ret == 0)
3462 if (ret == 0) {
3463 nvlist_free(errlist);
3463 return (0);
3464 return (0);
3465 }
3464
3465 if (nvlist_empty(errlist)) {
3466 char errbuf[1024];
3467 (void) snprintf(errbuf, sizeof (errbuf),
3468 dgettext(TEXT_DOMAIN, "cannot destroy snapshots"));
3469
3470 ret = zfs_standard_error(hdl, ret, errbuf);
3471 }

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

3483 ret = zfs_error(hdl, EZFS_EXISTS, errbuf);
3484 break;
3485 default:
3486 ret = zfs_standard_error(hdl, errno, errbuf);
3487 break;
3488 }
3489 }
3490
3466
3467 if (nvlist_empty(errlist)) {
3468 char errbuf[1024];
3469 (void) snprintf(errbuf, sizeof (errbuf),
3470 dgettext(TEXT_DOMAIN, "cannot destroy snapshots"));
3471
3472 ret = zfs_standard_error(hdl, ret, errbuf);
3473 }

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

3485 ret = zfs_error(hdl, EZFS_EXISTS, errbuf);
3486 break;
3487 default:
3488 ret = zfs_standard_error(hdl, errno, errbuf);
3489 break;
3490 }
3491 }
3492
3493 nvlist_free(errlist);
3491 return (ret);
3492}
3493
3494/*
3495 * Clones the given dataset. The target must be of the same type as the source.
3496 */
3497int
3498zfs_clone(zfs_handle_t *zhp, const char *target, nvlist_t *props)

--- 1391 unchanged lines hidden ---
3494 return (ret);
3495}
3496
3497/*
3498 * Clones the given dataset. The target must be of the same type as the source.
3499 */
3500int
3501zfs_clone(zfs_handle_t *zhp, const char *target, nvlist_t *props)

--- 1391 unchanged lines hidden ---