Lines Matching refs:zhp

388 	zfs_handle_t		*zhp = NULL;  in be_destroy()  local
507 if ((zhp = zfs_open(g_zfs, bt.obe_root_ds, ZFS_TYPE_FILESYSTEM)) == in be_destroy()
519 (void) zfs_iter_snapshots(zhp, B_FALSE, be_has_snapshot_callback, in be_destroy()
522 ZFS_CLOSE(zhp); in be_destroy()
528 if (be_get_uuid(zfs_get_name(zhp), in be_destroy()
531 "UUID (%s)\n"), zfs_get_name(zhp)); in be_destroy()
539 if (zfs_is_mounted(zhp, &mp)) { in be_destroy()
546 ZFS_CLOSE(zhp); in be_destroy()
567 if (zfs_is_mounted(zhp, NULL)) { in be_destroy()
572 ZFS_CLOSE(zhp); in be_destroy()
576 ZFS_CLOSE(zhp); in be_destroy()
639 zfs_handle_t *zhp = NULL; in be_copy() local
924 if ((zhp = zfs_open(g_zfs, bt.obe_root_ds, ZFS_TYPE_FILESYSTEM)) in be_copy()
934 if (zfs_is_mounted(zhp, &bt.obe_altroot) && bt.obe_altroot == NULL) { in be_copy()
951 if ((ret = be_clone_fs_callback(zhp, &bt)) != 0) { in be_copy()
952 zhp = NULL; in be_copy()
1003 if ((zhp = zfs_open(g_zfs, bt.obe_root_ds, in be_copy()
1019 ret = be_clone_fs_callback(zhp, &bt); in be_copy()
1020 zhp = NULL; in be_copy()
1047 zhp = NULL; in be_copy()
1067 if ((ret = be_send_fs_callback(zhp, &bt)) != 0) { in be_copy()
1072 zhp = NULL; in be_copy()
1075 zhp = NULL; in be_copy()
1197 if ((zhp = zfs_open(g_zfs, bt.nbe_root_ds, in be_copy()
1214 if (zfs_prop_set(zhp, BE_POLICY_PROPERTY, bt.policy) != 0) { in be_copy()
1235 ZFS_CLOSE(zhp); in be_copy()
1376 be_has_snapshot_callback(zfs_handle_t *zhp, void *data) in be_has_snapshot_callback() argument
1379 if (zfs_get_name(zhp) == NULL) { in be_has_snapshot_callback()
1380 zfs_close(zhp); in be_has_snapshot_callback()
1384 zfs_close(zhp); in be_has_snapshot_callback()
1407 zfs_handle_t *zhp = NULL; in be_set_uuid() local
1422 if ((zhp = zfs_open(g_zfs, root_ds, ZFS_TYPE_FILESYSTEM)) == NULL) { in be_set_uuid()
1430 if (zfs_prop_set(zhp, BE_UUID_PROPERTY, uu_string) != 0) { in be_set_uuid()
1437 ZFS_CLOSE(zhp); in be_set_uuid()
1460 zfs_handle_t *zhp = NULL; in be_get_uuid() local
1467 if ((zhp = zfs_open(g_zfs, root_ds, ZFS_TYPE_FILESYSTEM)) == NULL) { in be_get_uuid()
1475 if ((userprops = zfs_get_user_props(zhp)) == NULL) { in be_get_uuid()
1506 ZFS_CLOSE(zhp); in be_get_uuid()
1534 zfs_handle_t *zhp = NULL; in _be_destroy() local
1542 if ((zhp = zfs_open(g_zfs, root_ds, ZFS_TYPE_FILESYSTEM)) == in _be_destroy()
1555 if (be_demote_callback(zhp, NULL) != 0) { in _be_destroy()
1562 if ((zhp = zfs_open(g_zfs, root_ds, ZFS_TYPE_FILESYSTEM)) == in _be_destroy()
1574 if (zfs_prop_get(zhp, ZFS_PROP_ORIGIN, origin, sizeof (origin), NULL, in _be_destroy()
1578 ZFS_CLOSE(zhp); in _be_destroy()
1591 if (be_destroy_callback(zhp, dd) != 0) { in _be_destroy()
1605 if ((zhp = zfs_open(g_zfs, origin, ZFS_TYPE_SNAPSHOT)) == in _be_destroy()
1615 if (zfs_prop_get_int(zhp, ZFS_PROP_NUMCLONES) != 0) { in _be_destroy()
1616 ZFS_CLOSE(zhp); in _be_destroy()
1619 ZFS_CLOSE(zhp); in _be_destroy()
1622 if ((zhp = zfs_open(g_zfs, parent, ZFS_TYPE_FILESYSTEM)) == in _be_destroy()
1640 if (zfs_destroy_snaps(zhp, snap, B_FALSE) != 0) { in _be_destroy()
1656 ZFS_CLOSE(zhp); in _be_destroy()
1660 ZFS_CLOSE(zhp); in _be_destroy()
1697 zfs_handle_t *zhp = NULL; in be_destroy_zones() local
1712 if ((zhp = zfs_open(g_zfs, be_root_ds, ZFS_TYPE_FILESYSTEM)) == in be_destroy_zones()
1725 if (!zfs_is_mounted(zhp, &mp)) { in be_destroy_zones()
1731 ZFS_CLOSE(zhp); in be_destroy_zones()
1736 ZFS_CLOSE(zhp); in be_destroy_zones()
1820 zfs_handle_t *zhp; in be_destroy_zone_roots() local
1833 if ((zhp = zfs_open(g_zfs, zone_container_ds, ZFS_TYPE_FILESYSTEM)) in be_destroy_zone_roots()
1845 if ((ret = zfs_iter_filesystems(zhp, be_destroy_zone_roots_callback, in be_destroy_zone_roots()
1850 ZFS_CLOSE(zhp); in be_destroy_zone_roots()
1853 ZFS_CLOSE(zhp); in be_destroy_zone_roots()
1856 if ((zhp = zfs_open(g_zfs, zone_container_ds, ZFS_TYPE_FILESYSTEM)) in be_destroy_zone_roots()
1868 if (zfs_iter_filesystems(zhp, be_zone_root_exists_callback, NULL) in be_destroy_zone_roots()
1871 if (zfs_unmount(zhp, NULL, MS_FORCE) != 0 || in be_destroy_zone_roots()
1872 zfs_destroy(zhp, B_FALSE) != 0) { in be_destroy_zone_roots()
1878 ZFS_CLOSE(zhp); in be_destroy_zone_roots()
1881 if ((zhp = zfs_open(g_zfs, zonepath_ds, ZFS_TYPE_FILESYSTEM)) in be_destroy_zone_roots()
1890 if (zfs_unmount(zhp, NULL, MS_FORCE) != 0 || in be_destroy_zone_roots()
1891 zfs_destroy(zhp, B_FALSE) != 0) { in be_destroy_zone_roots()
1900 ZFS_CLOSE(zhp); in be_destroy_zone_roots()
1920 be_destroy_zone_roots_callback(zfs_handle_t *zhp, void *data) in be_destroy_zone_roots_callback() argument
1926 if (be_zone_get_parent_uuid(zfs_get_name(zhp), &parent_uuid) in be_destroy_zone_roots_callback()
1930 zfs_get_name(zhp)); in be_destroy_zone_roots_callback()
1931 ZFS_CLOSE(zhp); in be_destroy_zone_roots_callback()
1940 if ((ret = _be_destroy(zfs_get_name(zhp), dd)) != BE_SUCCESS) { in be_destroy_zone_roots_callback()
1943 zfs_get_name(zhp)); in be_destroy_zone_roots_callback()
1944 ZFS_CLOSE(zhp); in be_destroy_zone_roots_callback()
1948 ZFS_CLOSE(zhp); in be_destroy_zone_roots_callback()
2356 be_clone_fs_callback(zfs_handle_t *zhp, void *data) in be_clone_fs_callback() argument
2366 if (zfs_prop_get(zhp, ZFS_PROP_MOUNTPOINT, prop_buf, in be_clone_fs_callback()
2370 zfs_get_name(zhp), libzfs_error_description(g_zfs)); in be_clone_fs_callback()
2372 ZFS_CLOSE(zhp); in be_clone_fs_callback()
2376 if (zfs_prop_get_int(zhp, ZFS_PROP_ZONED) != 0 && in be_clone_fs_callback()
2389 (void) strlcpy(zhp_name, zfs_get_name(zhp), sizeof (zhp_name)); in be_clone_fs_callback()
2394 if ((ret = be_prep_clone_send_fs(zhp, bt, clone_ds, in be_clone_fs_callback()
2396 ZFS_CLOSE(zhp); in be_clone_fs_callback()
2414 ZFS_CLOSE(zhp); in be_clone_fs_callback()
2427 ZFS_CLOSE(zhp); in be_clone_fs_callback()
2439 if ((ret = zfs_iter_filesystems(zhp, be_clone_fs_callback, bt)) != 0) { in be_clone_fs_callback()
2446 ZFS_CLOSE(zhp); in be_clone_fs_callback()
2458 ZFS_CLOSE(zhp); in be_clone_fs_callback()
2477 be_send_fs_callback(zfs_handle_t *zhp, void *data) in be_send_fs_callback() argument
2491 (void) strlcpy(zhp_name, zfs_get_name(zhp), sizeof (zhp_name)); in be_send_fs_callback()
2496 if ((ret = be_prep_clone_send_fs(zhp, bt, clone_ds, in be_send_fs_callback()
2498 ZFS_CLOSE(zhp); in be_send_fs_callback()
2511 ZFS_CLOSE(zhp); in be_send_fs_callback()
2528 ZFS_CLOSE(zhp); in be_send_fs_callback()
2540 ZFS_CLOSE(zhp); in be_send_fs_callback()
2546 if (zfs_send(zhp, NULL, bt->obe_snap_name, &send_flags, in be_send_fs_callback()
2550 ZFS_CLOSE(zhp); in be_send_fs_callback()
2575 ZFS_CLOSE(zhp); in be_send_fs_callback()
2584 if ((ret = zfs_iter_filesystems(zhp, be_send_fs_callback, bt)) != 0) { in be_send_fs_callback()
2591 ZFS_CLOSE(zhp); in be_send_fs_callback()
2603 ZFS_CLOSE(zhp); in be_send_fs_callback()
2621 be_destroy_callback(zfs_handle_t *zhp, void *data) in be_destroy_callback() argument
2630 if ((ret = zfs_iter_filesystems(zhp, be_destroy_callback, dd)) != 0) { in be_destroy_callback()
2631 ZFS_CLOSE(zhp); in be_destroy_callback()
2640 if ((ret = zfs_iter_snapshots(zhp, B_FALSE, be_destroy_callback, in be_destroy_callback()
2643 ZFS_CLOSE(zhp); in be_destroy_callback()
2650 if ((ret = zfs_unmount(zhp, NULL, MS_FORCE)) != 0) { in be_destroy_callback()
2652 "failed to unmount %s: %s\n"), zfs_get_name(zhp), in be_destroy_callback()
2655 ZFS_CLOSE(zhp); in be_destroy_callback()
2660 if (zfs_destroy(zhp, B_FALSE) != 0) { in be_destroy_callback()
2662 "failed to destroy %s: %s\n"), zfs_get_name(zhp), in be_destroy_callback()
2665 ZFS_CLOSE(zhp); in be_destroy_callback()
2669 ZFS_CLOSE(zhp); in be_destroy_callback()
2703 be_demote_callback(zfs_handle_t *zhp, void *data) in be_demote_callback() argument
2716 if (zfs_iter_snapshots(zhp, B_FALSE, in be_demote_callback()
2720 zfs_get_name(zhp), libzfs_error_description(g_zfs)); in be_demote_callback()
2722 ZFS_CLOSE(zhp); in be_demote_callback()
2734 ZFS_CLOSE(zhp); in be_demote_callback()
2753 if ((ret = zfs_iter_filesystems(zhp, be_demote_callback, NULL)) != 0) { in be_demote_callback()
2754 ZFS_CLOSE(zhp); in be_demote_callback()
2758 ZFS_CLOSE(zhp); in be_demote_callback()
2779 be_demote_find_clone_callback(zfs_handle_t *zhp, void *data) in be_demote_find_clone_callback() argument
2786 if (zfs_prop_get_int(zhp, ZFS_PROP_NUMCLONES) == 0) { in be_demote_find_clone_callback()
2787 ZFS_CLOSE(zhp); in be_demote_find_clone_callback()
2791 dd->snapshot = zfs_get_name(zhp); in be_demote_find_clone_callback()
2794 snap_creation = (time_t)zfs_prop_get_int(zhp, ZFS_PROP_CREATION); in be_demote_find_clone_callback()
2806 if ((zret = zfs_iter_dependents(zhp, B_FALSE, in be_demote_find_clone_callback()
2810 zfs_get_name(zhp)); in be_demote_find_clone_callback()
2811 ZFS_CLOSE(zhp); in be_demote_find_clone_callback()
2822 ZFS_CLOSE(zhp); in be_demote_find_clone_callback()
2844 be_demote_get_one_clone(zfs_handle_t *zhp, void *data) in be_demote_get_one_clone() argument
2850 if (zfs_get_type(zhp) != ZFS_TYPE_FILESYSTEM) { in be_demote_get_one_clone()
2851 ZFS_CLOSE(zhp); in be_demote_get_one_clone()
2855 (void) strlcpy(ds_path, zfs_get_name(zhp), sizeof (ds_path)); in be_demote_get_one_clone()
2861 if (zfs_prop_get(zhp, ZFS_PROP_ORIGIN, origin, sizeof (origin), NULL, in be_demote_get_one_clone()
2866 ZFS_CLOSE(zhp); in be_demote_get_one_clone()
2870 ZFS_CLOSE(zhp); in be_demote_get_one_clone()
2879 dd->clone_zhp = zhp; in be_demote_get_one_clone()
2883 ZFS_CLOSE(zhp); in be_demote_get_one_clone()
2890 dd->clone_zhp = zhp; in be_demote_get_one_clone()
3023 be_prep_clone_send_fs(zfs_handle_t *zhp, be_transaction_data_t *bt, in be_prep_clone_send_fs() argument
3037 (void) strlcpy(zhp_name, zfs_get_name(zhp), sizeof (zhp_name)); in be_prep_clone_send_fs()
3063 if (zfs_prop_get(zhp, ZFS_PROP_MOUNTPOINT, mountpoint, in be_prep_clone_send_fs()
3096 "/") != 0 && zfs_is_mounted(zhp, NULL)) { in be_prep_clone_send_fs()
3176 be_zone_root_exists_callback(zfs_handle_t *zhp, void *data) in be_zone_root_exists_callback() argument
3178 ZFS_CLOSE(zhp); in be_zone_root_exists_callback()