589 "failed to create unique auto snapshot "
590 "name\n"));
591 free(bt.obe_snap_name);
592 bt.obe_snap_name = NULL;
593 ret = BE_ERR_AUTONAME;
594 }
595 }
596 }
597
598 /*
599 * If we succeeded in creating an auto named snapshot, store
600 * the name in the nvlist passed in by the caller.
601 */
602 if (autoname && bt.obe_snap_name) {
603 *snap_name = bt.obe_snap_name;
604 }
605
606 done:
607 ZFS_CLOSE(zhp);
608
609 if (ss_props != NULL)
610 nvlist_free(ss_props);
611
612 return (ret);
613 }
614
615 /*
616 * Function: _be_destroy_snapshot
617 * Description: see be_destroy_snapshot
618 * Parameters:
619 * be_name - The name of the BE that the snapshot belongs to.
620 * snap_name - The name of the snapshot we're destroying.
621 * Return:
622 * BE_SUCCESS - Success
623 * be_errno_t - Failure
624 * Scope:
625 * Semi-private (library wide use only)
626 */
627 int
628 _be_destroy_snapshot(char *be_name, char *snap_name)
629 {
|
589 "failed to create unique auto snapshot "
590 "name\n"));
591 free(bt.obe_snap_name);
592 bt.obe_snap_name = NULL;
593 ret = BE_ERR_AUTONAME;
594 }
595 }
596 }
597
598 /*
599 * If we succeeded in creating an auto named snapshot, store
600 * the name in the nvlist passed in by the caller.
601 */
602 if (autoname && bt.obe_snap_name) {
603 *snap_name = bt.obe_snap_name;
604 }
605
606 done:
607 ZFS_CLOSE(zhp);
608
609 nvlist_free(ss_props);
610
611 return (ret);
612 }
613
614 /*
615 * Function: _be_destroy_snapshot
616 * Description: see be_destroy_snapshot
617 * Parameters:
618 * be_name - The name of the BE that the snapshot belongs to.
619 * snap_name - The name of the snapshot we're destroying.
620 * Return:
621 * BE_SUCCESS - Success
622 * be_errno_t - Failure
623 * Scope:
624 * Semi-private (library wide use only)
625 */
626 int
627 _be_destroy_snapshot(char *be_name, char *snap_name)
628 {
|