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