Deleted Added
full compact
libzfs_core.c (302408) libzfs_core.c (307108)
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

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

260 * be the errno of a (unspecified) snapshot that failed.
261 */
262int
263lzc_snapshot(nvlist_t *snaps, nvlist_t *props, nvlist_t **errlist)
264{
265 nvpair_t *elem;
266 nvlist_t *args;
267 int error;
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

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

260 * be the errno of a (unspecified) snapshot that failed.
261 */
262int
263lzc_snapshot(nvlist_t *snaps, nvlist_t *props, nvlist_t **errlist)
264{
265 nvpair_t *elem;
266 nvlist_t *args;
267 int error;
268 char pool[MAXNAMELEN];
268 char pool[ZFS_MAX_DATASET_NAME_LEN];
269
270 *errlist = NULL;
271
272 /* determine the pool name */
273 elem = nvlist_next_nvpair(snaps, NULL);
274 if (elem == NULL)
275 return (0);
276 (void) strlcpy(pool, nvpair_name(elem), sizeof (pool));

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

312 * the (int32) error code.
313 */
314int
315lzc_destroy_snaps(nvlist_t *snaps, boolean_t defer, nvlist_t **errlist)
316{
317 nvpair_t *elem;
318 nvlist_t *args;
319 int error;
269
270 *errlist = NULL;
271
272 /* determine the pool name */
273 elem = nvlist_next_nvpair(snaps, NULL);
274 if (elem == NULL)
275 return (0);
276 (void) strlcpy(pool, nvpair_name(elem), sizeof (pool));

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

312 * the (int32) error code.
313 */
314int
315lzc_destroy_snaps(nvlist_t *snaps, boolean_t defer, nvlist_t **errlist)
316{
317 nvpair_t *elem;
318 nvlist_t *args;
319 int error;
320 char pool[MAXNAMELEN];
320 char pool[ZFS_MAX_DATASET_NAME_LEN];
321
322 /* determine the pool name */
323 elem = nvlist_next_nvpair(snaps, NULL);
324 if (elem == NULL)
325 return (0);
326 (void) strlcpy(pool, nvpair_name(elem), sizeof (pool));
327 pool[strcspn(pool, "/@")] = '\0';
328

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

339
340int
341lzc_snaprange_space(const char *firstsnap, const char *lastsnap,
342 uint64_t *usedp)
343{
344 nvlist_t *args;
345 nvlist_t *result;
346 int err;
321
322 /* determine the pool name */
323 elem = nvlist_next_nvpair(snaps, NULL);
324 if (elem == NULL)
325 return (0);
326 (void) strlcpy(pool, nvpair_name(elem), sizeof (pool));
327 pool[strcspn(pool, "/@")] = '\0';
328

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

339
340int
341lzc_snaprange_space(const char *firstsnap, const char *lastsnap,
342 uint64_t *usedp)
343{
344 nvlist_t *args;
345 nvlist_t *result;
346 int err;
347 char fs[MAXNAMELEN];
347 char fs[ZFS_MAX_DATASET_NAME_LEN];
348 char *atp;
349
350 /* determine the fs name */
351 (void) strlcpy(fs, firstsnap, sizeof (fs));
352 atp = strchr(fs, '@');
353 if (atp == NULL)
354 return (EINVAL);
355 *atp = '\0';

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

404 * failed and no holds will be created.
405 *
406 * In all cases the errlist will have an entry for each hold that failed
407 * (name = snapshot), with its value being the error code (int32).
408 */
409int
410lzc_hold(nvlist_t *holds, int cleanup_fd, nvlist_t **errlist)
411{
348 char *atp;
349
350 /* determine the fs name */
351 (void) strlcpy(fs, firstsnap, sizeof (fs));
352 atp = strchr(fs, '@');
353 if (atp == NULL)
354 return (EINVAL);
355 *atp = '\0';

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

404 * failed and no holds will be created.
405 *
406 * In all cases the errlist will have an entry for each hold that failed
407 * (name = snapshot), with its value being the error code (int32).
408 */
409int
410lzc_hold(nvlist_t *holds, int cleanup_fd, nvlist_t **errlist)
411{
412 char pool[MAXNAMELEN];
412 char pool[ZFS_MAX_DATASET_NAME_LEN];
413 nvlist_t *args;
414 nvpair_t *elem;
415 int error;
416
417 /* determine the pool name */
418 elem = nvlist_next_nvpair(holds, NULL);
419 if (elem == NULL)
420 return (0);

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

451 * failed to release and no holds will be released.
452 *
453 * In all cases the errlist will have an entry for each hold that failed to
454 * to release.
455 */
456int
457lzc_release(nvlist_t *holds, nvlist_t **errlist)
458{
413 nvlist_t *args;
414 nvpair_t *elem;
415 int error;
416
417 /* determine the pool name */
418 elem = nvlist_next_nvpair(holds, NULL);
419 if (elem == NULL)
420 return (0);

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

451 * failed to release and no holds will be released.
452 *
453 * In all cases the errlist will have an entry for each hold that failed to
454 * to release.
455 */
456int
457lzc_release(nvlist_t *holds, nvlist_t **errlist)
458{
459 char pool[MAXNAMELEN];
459 char pool[ZFS_MAX_DATASET_NAME_LEN];
460 nvpair_t *elem;
461
462 /* determine the pool name */
463 elem = nvlist_next_nvpair(holds, NULL);
464 if (elem == NULL)
465 return (0);
466 (void) strlcpy(pool, nvpair_name(elem), sizeof (pool));
467 pool[strcspn(pool, "/@")] = '\0';

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

738 * The return value will be 0 if all bookmarks were created, otherwise it will
739 * be the errno of a (undetermined) bookmarks that failed.
740 */
741int
742lzc_bookmark(nvlist_t *bookmarks, nvlist_t **errlist)
743{
744 nvpair_t *elem;
745 int error;
460 nvpair_t *elem;
461
462 /* determine the pool name */
463 elem = nvlist_next_nvpair(holds, NULL);
464 if (elem == NULL)
465 return (0);
466 (void) strlcpy(pool, nvpair_name(elem), sizeof (pool));
467 pool[strcspn(pool, "/@")] = '\0';

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

738 * The return value will be 0 if all bookmarks were created, otherwise it will
739 * be the errno of a (undetermined) bookmarks that failed.
740 */
741int
742lzc_bookmark(nvlist_t *bookmarks, nvlist_t **errlist)
743{
744 nvpair_t *elem;
745 int error;
746 char pool[MAXNAMELEN];
746 char pool[ZFS_MAX_DATASET_NAME_LEN];
747
748 /* determine the pool name */
749 elem = nvlist_next_nvpair(bookmarks, NULL);
750 if (elem == NULL)
751 return (0);
752 (void) strlcpy(pool, nvpair_name(elem), sizeof (pool));
753 pool[strcspn(pool, "/#")] = '\0';
754

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

800 * entry for each bookmarks that failed. The value in the errlist will be
801 * the (int32) error code.
802 */
803int
804lzc_destroy_bookmarks(nvlist_t *bmarks, nvlist_t **errlist)
805{
806 nvpair_t *elem;
807 int error;
747
748 /* determine the pool name */
749 elem = nvlist_next_nvpair(bookmarks, NULL);
750 if (elem == NULL)
751 return (0);
752 (void) strlcpy(pool, nvpair_name(elem), sizeof (pool));
753 pool[strcspn(pool, "/#")] = '\0';
754

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

800 * entry for each bookmarks that failed. The value in the errlist will be
801 * the (int32) error code.
802 */
803int
804lzc_destroy_bookmarks(nvlist_t *bmarks, nvlist_t **errlist)
805{
806 nvpair_t *elem;
807 int error;
808 char pool[MAXNAMELEN];
808 char pool[ZFS_MAX_DATASET_NAME_LEN];
809
810 /* determine the pool name */
811 elem = nvlist_next_nvpair(bmarks, NULL);
812 if (elem == NULL)
813 return (0);
814 (void) strlcpy(pool, nvpair_name(elem), sizeof (pool));
815 pool[strcspn(pool, "/#")] = '\0';
816
817 error = lzc_ioctl(ZFS_IOC_DESTROY_BOOKMARKS, pool, bmarks, errlist);
818
819 return (error);
820}
809
810 /* determine the pool name */
811 elem = nvlist_next_nvpair(bmarks, NULL);
812 if (elem == NULL)
813 return (0);
814 (void) strlcpy(pool, nvpair_name(elem), sizeof (pool));
815 pool[strcspn(pool, "/#")] = '\0';
816
817 error = lzc_ioctl(ZFS_IOC_DESTROY_BOOKMARKS, pool, bmarks, errlist);
818
819 return (error);
820}