Lines Matching refs:zhp

382 	zfs_handle_t		*zhp = NULL;  in be_destroy()  local
475 if ((zhp = zfs_open(g_zfs, bt.obe_root_ds, ZFS_TYPE_FILESYSTEM)) == in be_destroy()
487 (void) zfs_iter_snapshots(zhp, be_has_snapshot_callback, &bs_found); in be_destroy()
489 ZFS_CLOSE(zhp); in be_destroy()
495 if (be_get_uuid(zfs_get_name(zhp), in be_destroy()
498 "UUID (%s)\n"), zfs_get_name(zhp)); in be_destroy()
506 if (zfs_is_mounted(zhp, &mp)) { in be_destroy()
513 ZFS_CLOSE(zhp); in be_destroy()
534 if (zfs_is_mounted(zhp, NULL)) { in be_destroy()
539 ZFS_CLOSE(zhp); in be_destroy()
543 ZFS_CLOSE(zhp); in be_destroy()
606 zfs_handle_t *zhp = NULL; in be_copy() local
877 if ((zhp = zfs_open(g_zfs, bt.obe_root_ds, ZFS_TYPE_FILESYSTEM)) in be_copy()
887 if (zfs_is_mounted(zhp, &bt.obe_altroot) && bt.obe_altroot == NULL) { in be_copy()
904 if ((ret = be_clone_fs_callback(zhp, &bt)) != 0) { in be_copy()
905 zhp = NULL; in be_copy()
949 if ((zhp = zfs_open(g_zfs, bt.obe_root_ds, in be_copy()
965 ret = be_clone_fs_callback(zhp, &bt); in be_copy()
966 zhp = NULL; in be_copy()
993 zhp = NULL; in be_copy()
1013 if ((ret = be_send_fs_callback(zhp, &bt)) != 0) { in be_copy()
1018 zhp = NULL; in be_copy()
1021 zhp = NULL; in be_copy()
1129 if ((zhp = zfs_open(g_zfs, bt.nbe_root_ds, in be_copy()
1146 if (zfs_prop_set(zhp, BE_POLICY_PROPERTY, bt.policy) != 0) { in be_copy()
1167 ZFS_CLOSE(zhp); in be_copy()
1301 be_has_snapshot_callback(zfs_handle_t *zhp, void *data) in be_has_snapshot_callback() argument
1304 if (zfs_get_name(zhp) == NULL) { in be_has_snapshot_callback()
1305 zfs_close(zhp); in be_has_snapshot_callback()
1309 zfs_close(zhp); in be_has_snapshot_callback()
1332 zfs_handle_t *zhp = NULL; in be_set_uuid() local
1347 if ((zhp = zfs_open(g_zfs, root_ds, ZFS_TYPE_FILESYSTEM)) == NULL) { in be_set_uuid()
1355 if (zfs_prop_set(zhp, BE_UUID_PROPERTY, uu_string) != 0) { in be_set_uuid()
1362 ZFS_CLOSE(zhp); in be_set_uuid()
1385 zfs_handle_t *zhp = NULL; in be_get_uuid() local
1392 if ((zhp = zfs_open(g_zfs, root_ds, ZFS_TYPE_FILESYSTEM)) == NULL) { in be_get_uuid()
1400 if ((userprops = zfs_get_user_props(zhp)) == NULL) { in be_get_uuid()
1431 ZFS_CLOSE(zhp); in be_get_uuid()
1459 zfs_handle_t *zhp = NULL; in _be_destroy() local
1467 if ((zhp = zfs_open(g_zfs, root_ds, ZFS_TYPE_FILESYSTEM)) == in _be_destroy()
1480 if (be_demote_callback(zhp, NULL) != 0) { in _be_destroy()
1487 if ((zhp = zfs_open(g_zfs, root_ds, ZFS_TYPE_FILESYSTEM)) == in _be_destroy()
1499 if (zfs_prop_get(zhp, ZFS_PROP_ORIGIN, origin, sizeof (origin), NULL, in _be_destroy()
1503 ZFS_CLOSE(zhp); in _be_destroy()
1516 if (be_destroy_callback(zhp, dd) != 0) { in _be_destroy()
1530 if ((zhp = zfs_open(g_zfs, origin, ZFS_TYPE_SNAPSHOT)) == in _be_destroy()
1540 if (zfs_prop_get_int(zhp, ZFS_PROP_NUMCLONES) != 0) { in _be_destroy()
1541 ZFS_CLOSE(zhp); in _be_destroy()
1544 ZFS_CLOSE(zhp); in _be_destroy()
1547 if ((zhp = zfs_open(g_zfs, parent, ZFS_TYPE_FILESYSTEM)) == in _be_destroy()
1565 if (zfs_destroy_snaps(zhp, snap, B_FALSE) != 0) { in _be_destroy()
1581 ZFS_CLOSE(zhp); in _be_destroy()
1585 ZFS_CLOSE(zhp); in _be_destroy()
1622 zfs_handle_t *zhp = NULL; in be_destroy_zones() local
1637 if ((zhp = zfs_open(g_zfs, be_root_ds, ZFS_TYPE_FILESYSTEM)) == in be_destroy_zones()
1650 if (!zfs_is_mounted(zhp, &mp)) { in be_destroy_zones()
1656 ZFS_CLOSE(zhp); in be_destroy_zones()
1661 ZFS_CLOSE(zhp); in be_destroy_zones()
1745 zfs_handle_t *zhp; in be_destroy_zone_roots() local
1754 if ((zhp = zfs_open(g_zfs, zone_container_ds, ZFS_TYPE_FILESYSTEM)) in be_destroy_zone_roots()
1766 if ((ret = zfs_iter_filesystems(zhp, be_destroy_zone_roots_callback, in be_destroy_zone_roots()
1771 ZFS_CLOSE(zhp); in be_destroy_zone_roots()
1774 ZFS_CLOSE(zhp); in be_destroy_zone_roots()
1777 if ((zhp = zfs_open(g_zfs, zone_container_ds, ZFS_TYPE_FILESYSTEM)) in be_destroy_zone_roots()
1789 if (zfs_iter_filesystems(zhp, be_zone_root_exists_callback, NULL) in be_destroy_zone_roots()
1792 if (zfs_unmount(zhp, NULL, MS_FORCE) != 0 || in be_destroy_zone_roots()
1793 zfs_destroy(zhp, B_FALSE) != 0) { in be_destroy_zone_roots()
1799 ZFS_CLOSE(zhp); in be_destroy_zone_roots()
1802 if ((zhp = zfs_open(g_zfs, zonepath_ds, ZFS_TYPE_FILESYSTEM)) in be_destroy_zone_roots()
1811 if (zfs_unmount(zhp, NULL, MS_FORCE) != 0 || in be_destroy_zone_roots()
1812 zfs_destroy(zhp, B_FALSE) != 0) { in be_destroy_zone_roots()
1821 ZFS_CLOSE(zhp); in be_destroy_zone_roots()
1841 be_destroy_zone_roots_callback(zfs_handle_t *zhp, void *data) in be_destroy_zone_roots_callback() argument
1847 if (be_zone_get_parent_uuid(zfs_get_name(zhp), &parent_uuid) in be_destroy_zone_roots_callback()
1851 zfs_get_name(zhp)); in be_destroy_zone_roots_callback()
1852 ZFS_CLOSE(zhp); in be_destroy_zone_roots_callback()
1861 if ((ret = _be_destroy(zfs_get_name(zhp), dd)) != BE_SUCCESS) { in be_destroy_zone_roots_callback()
1864 zfs_get_name(zhp)); in be_destroy_zone_roots_callback()
1865 ZFS_CLOSE(zhp); in be_destroy_zone_roots_callback()
1869 ZFS_CLOSE(zhp); in be_destroy_zone_roots_callback()
2279 be_clone_fs_callback(zfs_handle_t *zhp, void *data) in be_clone_fs_callback() argument
2289 if (zfs_prop_get(zhp, ZFS_PROP_MOUNTPOINT, prop_buf, in be_clone_fs_callback()
2293 zfs_get_name(zhp), libzfs_error_description(g_zfs)); in be_clone_fs_callback()
2295 ZFS_CLOSE(zhp); in be_clone_fs_callback()
2299 if (zfs_prop_get_int(zhp, ZFS_PROP_ZONED) != 0 && in be_clone_fs_callback()
2312 (void) strlcpy(zhp_name, zfs_get_name(zhp), sizeof (zhp_name)); in be_clone_fs_callback()
2317 if ((ret = be_prep_clone_send_fs(zhp, bt, clone_ds, in be_clone_fs_callback()
2319 ZFS_CLOSE(zhp); in be_clone_fs_callback()
2337 ZFS_CLOSE(zhp); in be_clone_fs_callback()
2350 ZFS_CLOSE(zhp); in be_clone_fs_callback()
2362 if ((ret = zfs_iter_filesystems(zhp, be_clone_fs_callback, bt)) != 0) { in be_clone_fs_callback()
2369 ZFS_CLOSE(zhp); in be_clone_fs_callback()
2381 ZFS_CLOSE(zhp); in be_clone_fs_callback()
2400 be_send_fs_callback(zfs_handle_t *zhp, void *data) in be_send_fs_callback() argument
2414 (void) strlcpy(zhp_name, zfs_get_name(zhp), sizeof (zhp_name)); in be_send_fs_callback()
2419 if ((ret = be_prep_clone_send_fs(zhp, bt, clone_ds, in be_send_fs_callback()
2421 ZFS_CLOSE(zhp); in be_send_fs_callback()
2434 ZFS_CLOSE(zhp); in be_send_fs_callback()
2451 ZFS_CLOSE(zhp); in be_send_fs_callback()
2463 ZFS_CLOSE(zhp); in be_send_fs_callback()
2469 if (zfs_send(zhp, NULL, bt->obe_snap_name, &send_flags, in be_send_fs_callback()
2473 ZFS_CLOSE(zhp); in be_send_fs_callback()
2498 ZFS_CLOSE(zhp); in be_send_fs_callback()
2507 if ((ret = zfs_iter_filesystems(zhp, be_send_fs_callback, bt)) != 0) { in be_send_fs_callback()
2514 ZFS_CLOSE(zhp); in be_send_fs_callback()
2526 ZFS_CLOSE(zhp); in be_send_fs_callback()
2544 be_destroy_callback(zfs_handle_t *zhp, void *data) in be_destroy_callback() argument
2553 if ((ret = zfs_iter_filesystems(zhp, be_destroy_callback, dd)) != 0) { in be_destroy_callback()
2554 ZFS_CLOSE(zhp); in be_destroy_callback()
2563 if ((ret = zfs_iter_snapshots(zhp, be_destroy_callback, dd)) in be_destroy_callback()
2565 ZFS_CLOSE(zhp); in be_destroy_callback()
2572 if ((ret = zfs_unmount(zhp, NULL, MS_FORCE)) != 0) { in be_destroy_callback()
2574 "failed to unmount %s: %s\n"), zfs_get_name(zhp), in be_destroy_callback()
2577 ZFS_CLOSE(zhp); in be_destroy_callback()
2582 if (zfs_destroy(zhp, B_FALSE) != 0) { in be_destroy_callback()
2584 "failed to destroy %s: %s\n"), zfs_get_name(zhp), in be_destroy_callback()
2587 ZFS_CLOSE(zhp); in be_destroy_callback()
2591 ZFS_CLOSE(zhp); in be_destroy_callback()
2625 be_demote_callback(zfs_handle_t *zhp, void *data) in be_demote_callback() argument
2638 if (zfs_iter_snapshots(zhp, be_demote_find_clone_callback, &dd) in be_demote_callback()
2642 zfs_get_name(zhp), libzfs_error_description(g_zfs)); in be_demote_callback()
2644 ZFS_CLOSE(zhp); in be_demote_callback()
2656 ZFS_CLOSE(zhp); in be_demote_callback()
2675 if ((ret = zfs_iter_filesystems(zhp, be_demote_callback, NULL)) != 0) { in be_demote_callback()
2676 ZFS_CLOSE(zhp); in be_demote_callback()
2680 ZFS_CLOSE(zhp); in be_demote_callback()
2701 be_demote_find_clone_callback(zfs_handle_t *zhp, void *data) in be_demote_find_clone_callback() argument
2708 if (zfs_prop_get_int(zhp, ZFS_PROP_NUMCLONES) == 0) { in be_demote_find_clone_callback()
2709 ZFS_CLOSE(zhp); in be_demote_find_clone_callback()
2713 dd->snapshot = zfs_get_name(zhp); in be_demote_find_clone_callback()
2716 snap_creation = (time_t)zfs_prop_get_int(zhp, ZFS_PROP_CREATION); in be_demote_find_clone_callback()
2728 if ((zret = zfs_iter_dependents(zhp, B_FALSE, in be_demote_find_clone_callback()
2732 zfs_get_name(zhp)); in be_demote_find_clone_callback()
2733 ZFS_CLOSE(zhp); in be_demote_find_clone_callback()
2744 ZFS_CLOSE(zhp); in be_demote_find_clone_callback()
2766 be_demote_get_one_clone(zfs_handle_t *zhp, void *data) in be_demote_get_one_clone() argument
2772 if (zfs_get_type(zhp) != ZFS_TYPE_FILESYSTEM) { in be_demote_get_one_clone()
2773 ZFS_CLOSE(zhp); in be_demote_get_one_clone()
2777 (void) strlcpy(ds_path, zfs_get_name(zhp), sizeof (ds_path)); in be_demote_get_one_clone()
2783 if (zfs_prop_get(zhp, ZFS_PROP_ORIGIN, origin, sizeof (origin), NULL, in be_demote_get_one_clone()
2788 ZFS_CLOSE(zhp); in be_demote_get_one_clone()
2792 ZFS_CLOSE(zhp); in be_demote_get_one_clone()
2801 dd->clone_zhp = zhp; in be_demote_get_one_clone()
2805 ZFS_CLOSE(zhp); in be_demote_get_one_clone()
2812 dd->clone_zhp = zhp; in be_demote_get_one_clone()
2941 be_prep_clone_send_fs(zfs_handle_t *zhp, be_transaction_data_t *bt, in be_prep_clone_send_fs() argument
2955 (void) strlcpy(zhp_name, zfs_get_name(zhp), sizeof (zhp_name)); in be_prep_clone_send_fs()
2981 if (zfs_prop_get(zhp, ZFS_PROP_MOUNTPOINT, mountpoint, in be_prep_clone_send_fs()
3014 "/") != 0 && zfs_is_mounted(zhp, NULL)) { in be_prep_clone_send_fs()
3094 be_zone_root_exists_callback(zfs_handle_t *zhp, void *data) in be_zone_root_exists_callback() argument
3096 ZFS_CLOSE(zhp); in be_zone_root_exists_callback()