Lines Matching refs:zhp

381 	zfs_handle_t		*zhp = NULL;  in be_destroy()  local
474 if ((zhp = zfs_open(g_zfs, bt.obe_root_ds, ZFS_TYPE_FILESYSTEM)) == in be_destroy()
486 (void) zfs_iter_snapshots(zhp, be_has_snapshot_callback, &bs_found); in be_destroy()
488 ZFS_CLOSE(zhp); in be_destroy()
494 if (be_get_uuid(zfs_get_name(zhp), in be_destroy()
497 "UUID (%s)\n"), zfs_get_name(zhp)); in be_destroy()
505 if (zfs_is_mounted(zhp, &mp)) { in be_destroy()
512 ZFS_CLOSE(zhp); in be_destroy()
533 if (zfs_is_mounted(zhp, NULL)) { in be_destroy()
538 ZFS_CLOSE(zhp); in be_destroy()
542 ZFS_CLOSE(zhp); in be_destroy()
605 zfs_handle_t *zhp = NULL; in be_copy() local
876 if ((zhp = zfs_open(g_zfs, bt.obe_root_ds, ZFS_TYPE_FILESYSTEM)) in be_copy()
886 if (zfs_is_mounted(zhp, &bt.obe_altroot) && bt.obe_altroot == NULL) { in be_copy()
903 if ((ret = be_clone_fs_callback(zhp, &bt)) != 0) { in be_copy()
904 zhp = NULL; in be_copy()
948 if ((zhp = zfs_open(g_zfs, bt.obe_root_ds, in be_copy()
964 ret = be_clone_fs_callback(zhp, &bt); in be_copy()
965 zhp = NULL; in be_copy()
992 zhp = NULL; in be_copy()
1012 if ((ret = be_send_fs_callback(zhp, &bt)) != 0) { in be_copy()
1017 zhp = NULL; in be_copy()
1020 zhp = NULL; in be_copy()
1128 if ((zhp = zfs_open(g_zfs, bt.nbe_root_ds, in be_copy()
1145 if (zfs_prop_set(zhp, BE_POLICY_PROPERTY, bt.policy) != 0) { in be_copy()
1166 ZFS_CLOSE(zhp); in be_copy()
1299 be_has_snapshot_callback(zfs_handle_t *zhp, void *data) in be_has_snapshot_callback() argument
1302 if (zfs_get_name(zhp) == NULL) { in be_has_snapshot_callback()
1303 zfs_close(zhp); in be_has_snapshot_callback()
1307 zfs_close(zhp); in be_has_snapshot_callback()
1330 zfs_handle_t *zhp = NULL; in be_set_uuid() local
1345 if ((zhp = zfs_open(g_zfs, root_ds, ZFS_TYPE_FILESYSTEM)) == NULL) { in be_set_uuid()
1353 if (zfs_prop_set(zhp, BE_UUID_PROPERTY, uu_string) != 0) { in be_set_uuid()
1360 ZFS_CLOSE(zhp); in be_set_uuid()
1383 zfs_handle_t *zhp = NULL; in be_get_uuid() local
1390 if ((zhp = zfs_open(g_zfs, root_ds, ZFS_TYPE_FILESYSTEM)) == NULL) { in be_get_uuid()
1398 if ((userprops = zfs_get_user_props(zhp)) == NULL) { in be_get_uuid()
1429 ZFS_CLOSE(zhp); in be_get_uuid()
1457 zfs_handle_t *zhp = NULL; in _be_destroy() local
1465 if ((zhp = zfs_open(g_zfs, root_ds, ZFS_TYPE_FILESYSTEM)) == in _be_destroy()
1478 if (be_demote_callback(zhp, NULL) != 0) { in _be_destroy()
1485 if ((zhp = zfs_open(g_zfs, root_ds, ZFS_TYPE_FILESYSTEM)) == in _be_destroy()
1497 if (zfs_prop_get(zhp, ZFS_PROP_ORIGIN, origin, sizeof (origin), NULL, in _be_destroy()
1501 ZFS_CLOSE(zhp); in _be_destroy()
1514 if (be_destroy_callback(zhp, dd) != 0) { in _be_destroy()
1528 if ((zhp = zfs_open(g_zfs, origin, ZFS_TYPE_SNAPSHOT)) == in _be_destroy()
1538 if (zfs_prop_get_int(zhp, ZFS_PROP_NUMCLONES) != 0) { in _be_destroy()
1539 ZFS_CLOSE(zhp); in _be_destroy()
1542 ZFS_CLOSE(zhp); in _be_destroy()
1545 if ((zhp = zfs_open(g_zfs, parent, ZFS_TYPE_FILESYSTEM)) == in _be_destroy()
1563 if (zfs_destroy_snaps(zhp, snap, B_FALSE) != 0) { in _be_destroy()
1579 ZFS_CLOSE(zhp); in _be_destroy()
1583 ZFS_CLOSE(zhp); in _be_destroy()
1620 zfs_handle_t *zhp = NULL; in be_destroy_zones() local
1635 if ((zhp = zfs_open(g_zfs, be_root_ds, ZFS_TYPE_FILESYSTEM)) == in be_destroy_zones()
1648 if (!zfs_is_mounted(zhp, &mp)) { in be_destroy_zones()
1654 ZFS_CLOSE(zhp); in be_destroy_zones()
1659 ZFS_CLOSE(zhp); in be_destroy_zones()
1743 zfs_handle_t *zhp; in be_destroy_zone_roots() local
1752 if ((zhp = zfs_open(g_zfs, zone_container_ds, ZFS_TYPE_FILESYSTEM)) in be_destroy_zone_roots()
1764 if ((ret = zfs_iter_filesystems(zhp, be_destroy_zone_roots_callback, in be_destroy_zone_roots()
1769 ZFS_CLOSE(zhp); in be_destroy_zone_roots()
1772 ZFS_CLOSE(zhp); in be_destroy_zone_roots()
1775 if ((zhp = zfs_open(g_zfs, zone_container_ds, ZFS_TYPE_FILESYSTEM)) in be_destroy_zone_roots()
1787 if (zfs_iter_filesystems(zhp, be_zone_root_exists_callback, NULL) in be_destroy_zone_roots()
1790 if (zfs_unmount(zhp, NULL, MS_FORCE) != 0 || in be_destroy_zone_roots()
1791 zfs_destroy(zhp, B_FALSE) != 0) { in be_destroy_zone_roots()
1797 ZFS_CLOSE(zhp); in be_destroy_zone_roots()
1800 if ((zhp = zfs_open(g_zfs, zonepath_ds, ZFS_TYPE_FILESYSTEM)) in be_destroy_zone_roots()
1809 if (zfs_unmount(zhp, NULL, MS_FORCE) != 0 || in be_destroy_zone_roots()
1810 zfs_destroy(zhp, B_FALSE) != 0) { in be_destroy_zone_roots()
1819 ZFS_CLOSE(zhp); in be_destroy_zone_roots()
1839 be_destroy_zone_roots_callback(zfs_handle_t *zhp, void *data) in be_destroy_zone_roots_callback() argument
1845 if (be_zone_get_parent_uuid(zfs_get_name(zhp), &parent_uuid) in be_destroy_zone_roots_callback()
1849 zfs_get_name(zhp)); in be_destroy_zone_roots_callback()
1850 ZFS_CLOSE(zhp); in be_destroy_zone_roots_callback()
1859 if ((ret = _be_destroy(zfs_get_name(zhp), dd)) != BE_SUCCESS) { in be_destroy_zone_roots_callback()
1862 zfs_get_name(zhp)); in be_destroy_zone_roots_callback()
1863 ZFS_CLOSE(zhp); in be_destroy_zone_roots_callback()
1867 ZFS_CLOSE(zhp); in be_destroy_zone_roots_callback()
2271 be_clone_fs_callback(zfs_handle_t *zhp, void *data) in be_clone_fs_callback() argument
2281 if (zfs_prop_get(zhp, ZFS_PROP_MOUNTPOINT, prop_buf, in be_clone_fs_callback()
2285 zfs_get_name(zhp), libzfs_error_description(g_zfs)); in be_clone_fs_callback()
2287 ZFS_CLOSE(zhp); in be_clone_fs_callback()
2291 if (zfs_prop_get_int(zhp, ZFS_PROP_ZONED) != 0 && in be_clone_fs_callback()
2304 (void) strlcpy(zhp_name, zfs_get_name(zhp), sizeof (zhp_name)); in be_clone_fs_callback()
2309 if ((ret = be_prep_clone_send_fs(zhp, bt, clone_ds, in be_clone_fs_callback()
2311 ZFS_CLOSE(zhp); in be_clone_fs_callback()
2329 ZFS_CLOSE(zhp); in be_clone_fs_callback()
2342 ZFS_CLOSE(zhp); in be_clone_fs_callback()
2354 if ((ret = zfs_iter_filesystems(zhp, be_clone_fs_callback, bt)) != 0) { in be_clone_fs_callback()
2361 ZFS_CLOSE(zhp); in be_clone_fs_callback()
2373 ZFS_CLOSE(zhp); in be_clone_fs_callback()
2392 be_send_fs_callback(zfs_handle_t *zhp, void *data) in be_send_fs_callback() argument
2406 (void) strlcpy(zhp_name, zfs_get_name(zhp), sizeof (zhp_name)); in be_send_fs_callback()
2411 if ((ret = be_prep_clone_send_fs(zhp, bt, clone_ds, in be_send_fs_callback()
2413 ZFS_CLOSE(zhp); in be_send_fs_callback()
2426 ZFS_CLOSE(zhp); in be_send_fs_callback()
2443 ZFS_CLOSE(zhp); in be_send_fs_callback()
2455 ZFS_CLOSE(zhp); in be_send_fs_callback()
2461 if (zfs_send(zhp, NULL, bt->obe_snap_name, &send_flags, in be_send_fs_callback()
2465 ZFS_CLOSE(zhp); in be_send_fs_callback()
2490 ZFS_CLOSE(zhp); in be_send_fs_callback()
2499 if ((ret = zfs_iter_filesystems(zhp, be_send_fs_callback, bt)) != 0) { in be_send_fs_callback()
2506 ZFS_CLOSE(zhp); in be_send_fs_callback()
2518 ZFS_CLOSE(zhp); in be_send_fs_callback()
2536 be_destroy_callback(zfs_handle_t *zhp, void *data) in be_destroy_callback() argument
2545 if ((ret = zfs_iter_filesystems(zhp, be_destroy_callback, dd)) != 0) { in be_destroy_callback()
2546 ZFS_CLOSE(zhp); in be_destroy_callback()
2555 if ((ret = zfs_iter_snapshots(zhp, be_destroy_callback, dd)) in be_destroy_callback()
2557 ZFS_CLOSE(zhp); in be_destroy_callback()
2564 if ((ret = zfs_unmount(zhp, NULL, MS_FORCE)) != 0) { in be_destroy_callback()
2566 "failed to unmount %s: %s\n"), zfs_get_name(zhp), in be_destroy_callback()
2569 ZFS_CLOSE(zhp); in be_destroy_callback()
2574 if (zfs_destroy(zhp, B_FALSE) != 0) { in be_destroy_callback()
2576 "failed to destroy %s: %s\n"), zfs_get_name(zhp), in be_destroy_callback()
2579 ZFS_CLOSE(zhp); in be_destroy_callback()
2583 ZFS_CLOSE(zhp); in be_destroy_callback()
2617 be_demote_callback(zfs_handle_t *zhp, void *data) in be_demote_callback() argument
2630 if (zfs_iter_snapshots(zhp, be_demote_find_clone_callback, &dd) in be_demote_callback()
2634 zfs_get_name(zhp), libzfs_error_description(g_zfs)); in be_demote_callback()
2636 ZFS_CLOSE(zhp); in be_demote_callback()
2648 ZFS_CLOSE(zhp); in be_demote_callback()
2667 if ((ret = zfs_iter_filesystems(zhp, be_demote_callback, NULL)) != 0) { in be_demote_callback()
2668 ZFS_CLOSE(zhp); in be_demote_callback()
2672 ZFS_CLOSE(zhp); in be_demote_callback()
2693 be_demote_find_clone_callback(zfs_handle_t *zhp, void *data) in be_demote_find_clone_callback() argument
2700 if (zfs_prop_get_int(zhp, ZFS_PROP_NUMCLONES) == 0) { in be_demote_find_clone_callback()
2701 ZFS_CLOSE(zhp); in be_demote_find_clone_callback()
2705 dd->snapshot = zfs_get_name(zhp); in be_demote_find_clone_callback()
2708 snap_creation = (time_t)zfs_prop_get_int(zhp, ZFS_PROP_CREATION); in be_demote_find_clone_callback()
2720 if ((zret = zfs_iter_dependents(zhp, B_FALSE, in be_demote_find_clone_callback()
2724 zfs_get_name(zhp)); in be_demote_find_clone_callback()
2725 ZFS_CLOSE(zhp); in be_demote_find_clone_callback()
2736 ZFS_CLOSE(zhp); in be_demote_find_clone_callback()
2758 be_demote_get_one_clone(zfs_handle_t *zhp, void *data) in be_demote_get_one_clone() argument
2764 if (zfs_get_type(zhp) != ZFS_TYPE_FILESYSTEM) { in be_demote_get_one_clone()
2765 ZFS_CLOSE(zhp); in be_demote_get_one_clone()
2769 (void) strlcpy(ds_path, zfs_get_name(zhp), sizeof (ds_path)); in be_demote_get_one_clone()
2775 if (zfs_prop_get(zhp, ZFS_PROP_ORIGIN, origin, sizeof (origin), NULL, in be_demote_get_one_clone()
2780 ZFS_CLOSE(zhp); in be_demote_get_one_clone()
2784 ZFS_CLOSE(zhp); in be_demote_get_one_clone()
2793 dd->clone_zhp = zhp; in be_demote_get_one_clone()
2797 ZFS_CLOSE(zhp); in be_demote_get_one_clone()
2804 dd->clone_zhp = zhp; in be_demote_get_one_clone()
2933 be_prep_clone_send_fs(zfs_handle_t *zhp, be_transaction_data_t *bt, in be_prep_clone_send_fs() argument
2947 (void) strlcpy(zhp_name, zfs_get_name(zhp), sizeof (zhp_name)); in be_prep_clone_send_fs()
2973 if (zfs_prop_get(zhp, ZFS_PROP_MOUNTPOINT, mountpoint, in be_prep_clone_send_fs()
3006 "/") != 0 && zfs_is_mounted(zhp, NULL)) { in be_prep_clone_send_fs()
3086 be_zone_root_exists_callback(zfs_handle_t *zhp, void *data) in be_zone_root_exists_callback() argument
3088 ZFS_CLOSE(zhp); in be_zone_root_exists_callback()