/freebsd/sys/contrib/openzfs/lib/libzfs/ |
H A D | libzfs_dataset.c | 471 if ((zhp->zpool_hdl = zpool_handle(zhp)) == NULL) in make_dataset_handle_common() 493 free(zhp); in make_dataset_handle() 533 zhp->zpool_hdl = zpool_handle(zhp); in make_dataset_simple_handle_zc() 663 if ((zhp->zpool_hdl = zpool_handle(zhp)) == NULL) { in make_bookmark_handle() 689 dp->zhp = zhp; in zfs_open_bookmarks_cb() 776 zhp = cb_data.zhp; in zfs_open() 805 free(zhp); in zfs_close() 1815 zfs_prop_get_int(zhp, ZFS_PROP_ZONED), zhp, zhp->zpool_hdl, in zfs_prop_set_list_flags() 2136 zhp->zfs_props == zhp->zfs_recvd_props); in zfs_is_recvd_props_mode() 2143 zhp->zfs_props = zhp->zfs_recvd_props; in zfs_set_recvd_props_mode() [all …]
|
H A D | libzfs_iter.c | 290 search.zn_handle = zhp; in zfs_sort_snaps() 305 node->zn_handle = zhp; in zfs_sort_snaps() 390 zfs_close(zhp); in snapspec_cb() 514 zfs_handle_t *zhp; member 548 zfs_close(zhp); in iter_dependents_cb() 551 zfs_error_aux(zhp->zfs_hdl, in iter_dependents_cb() 554 zfs_get_name(zhp)); in iter_dependents_cb() 555 err = zfs_error(zhp->zfs_hdl, in iter_dependents_cb() 560 zfs_close(zhp); in iter_dependents_cb() 566 isf.zhp = zhp; in iter_dependents_cb() [all …]
|
H A D | libzfs_mount.c | 216 return (is_mounted(zhp->zfs_hdl, zfs_get_name(zhp), where)); in zfs_is_mounted() 414 zfs_refresh_properties(zhp); in zfs_mount_at() 530 zhp->zfs_name)); in zfs_mount_at() 573 if (zhp) { in unmount_one() 761 if (ZFS_IS_VOLUME(zhp)) in zfs_is_shared() 915 zfs_close(zhp); in zfs_iter_cb() 920 zfs_close(zhp); in zfs_iter_cb() 926 zfs_close(zhp); in zfs_iter_cb() 937 zfs_close(zhp); in zfs_iter_cb() 943 zfs_close(zhp); in zfs_iter_cb() [all …]
|
H A D | libzfs_crypto.c | 861 const char *fsname = (zhp) ? zfs_get_name(zhp) : NULL; in populate_create_encryption_params_nvlists() 1231 zfs_close(zhp); in load_keys_cb() 1249 if (zhp == NULL) { in zfs_crypto_attempt_load_keys() 1267 zfs_close(zhp); in zfs_crypto_attempt_load_keys() 1271 if (zhp != NULL) in zfs_crypto_attempt_load_keys() 1272 zfs_close(zhp); in zfs_crypto_attempt_load_keys() 1319 zfs_get_name(zhp)); in zfs_crypto_load_key() 1487 zfs_get_name(zhp)); in zfs_crypto_unload_key() 1569 new_props = zfs_valid_proplist(zhp->zfs_hdl, zhp->zfs_type, props, in zfs_crypto_verify_rewrap_nvlist() 1570 zfs_prop_get_int(zhp, ZFS_PROP_ZONED), NULL, zhp->zpool_hdl, in zfs_crypto_verify_rewrap_nvlist() [all …]
|
H A D | libzfs_pool.c | 148 if (zhp->zpool_props == NULL && zpool_get_all_props(zhp)) { in zpool_get_prop_int() 321 if (zhp->zpool_props == NULL && zpool_get_all_props(zhp) && in zpool_get_prop() 929 if (zhp->zpool_props == NULL && zpool_props_refresh(zhp)) in zpool_expand_proplist() 1276 (void) strlcpy(zhp->zpool_name, pool, sizeof (zhp->zpool_name)); in zpool_open_canfail() 1291 return (zhp); in zpool_open_canfail() 1320 *ret = zhp; in zpool_open_silent() 1343 return (zhp); in zpool_open() 1355 free(zhp); in zpool_close() 1854 zhp->zpool_name, zhp->zpool_name); in zpool_export_common() 3707 char *mpath = zpool_vdev_name(zhp->zpool_hdl, zhp, in find_vdev_entry() [all …]
|
H A D | libzfs_config.c | 207 *oldconfig = zhp->zpool_old_config; in zpool_get_config() 208 return (zhp->zpool_config); in zpool_get_config() 259 if (zhp->zpool_config_size == 0) in zpool_refresh_stats() 260 zhp->zpool_config_size = 1 << 16; in zpool_refresh_stats() 294 if (zhp->zpool_config != NULL) { in zpool_refresh_stats() 297 zhp->zpool_old_config = zhp->zpool_config; in zpool_refresh_stats() 300 zhp->zpool_config = config; in zpool_refresh_stats() 372 zpool_handle_t *zhp; in zpool_iter() local 396 if (zhp == NULL) in zpool_iter() 417 zfs_handle_t *zhp; in zfs_iter_root() local [all …]
|
H A D | libzfs_sendrecv.c | 319 zfs_close(zhp); in send_iterate_snap() 342 zfs_close(zhp); in send_iterate_snap() 347 zfs_close(zhp); in send_iterate_snap() 368 zfs_close(zhp); in send_iterate_snap() 459 zfs_close(zhp); in get_snap_guid() 676 zfs_close(zhp); in send_iterate_fs() 692 if (zhp == NULL) in gather_nvlist() 1246 if (zfs_send_space(zhp, zhp->zfs_name, in dump_snapshot() 1288 zfs_close(zhp); in dump_snapshot() 2560 .zhp = zhp, in zfs_send() [all …]
|
H A D | libzfs_diff.c | 300 zfs_error_aux(di->zhp->zfs_hdl, in write_inuse_diffs_one() 612 zfs_handle_t *zhp; in get_snapshot_names() local 618 while (zhp != NULL) { in get_snapshot_names() 621 (void) zfs_close(zhp); in get_snapshot_names() 622 zhp = NULL; in get_snapshot_names() 628 (void) zfs_close(zhp); in get_snapshot_names() 632 if (zhp == NULL) { in get_snapshot_names() 638 (void) zfs_close(zhp); in get_snapshot_names() 728 di->zhp = zhp; in setup_differ_info() 783 return (zfs_error(zhp->zfs_hdl, in zfs_show_diffs() [all …]
|
H A D | libzfs_changelist.c | 474 cn->cn_handle = zhp; in changelist_add_mounted() 475 cn->cn_mounted = zfs_is_mounted(zhp, NULL); in changelist_add_mounted() 477 cn->cn_shared = zfs_is_shared(zhp, NULL, NULL); in changelist_add_mounted() 491 zfs_close(zhp); in changelist_add_mounted() 498 change_one(zfs_handle_t *zhp, void *data) in change_one() argument 519 zfs_prop_get(zhp, clp->cl_prop, property, in change_one() 544 cn->cn_handle = zhp; in change_one() 546 zfs_is_mounted(zhp, NULL); in change_one() 578 zfs_close(zhp); in change_one() 657 if (zfs_prop_get(zhp, ZFS_PROP_MOUNTPOINT, in changelist_gather() [all …]
|
H A D | libzfs_import.c | 50 zpool_handle_t *zhp; in pool_active() local 52 if (zpool_open_silent(hdl, name, &zhp) != 0) in pool_active() 55 if (zhp == NULL) { in pool_active() 63 zpool_close(zhp); in pool_active() 248 find_aux(zpool_handle_t *zhp, void *data) in find_aux() argument 263 cbp->cb_zhp = zhp; in find_aux() 269 zpool_close(zhp); in find_aux() 286 zpool_handle_t *zhp; in zpool_in_use() local 325 zpool_close(zhp); in zpool_in_use() 373 if (zhp != NULL) in zpool_in_use() [all …]
|
/freebsd/sys/contrib/openzfs/cmd/zed/agents/ |
H A D | zfs_retire.c | 90 cbp->cb_zhp = zhp; in find_pool() 94 zpool_close(zhp); in find_pool() 161 zpool_close(zhp); in remove_spares() 167 zpool_close(zhp); in remove_spares() 185 zpool_close(zhp); in remove_spares() 222 zhp = cb.cb_zhp; in find_by_guid() 226 zpool_close(zhp); in find_by_guid() 232 zpool_close(zhp); in find_by_guid() 237 return (zhp); in find_by_guid() 469 zpool_close(zhp); in zfs_retire_recv() [all …]
|
H A D | zfs_mod.c | 132 zpool_get_name(zhp), (int)zfs_toplevel_state(zhp)); in zfs_unavail_pool() 142 uap->uap_zhp = zhp; in zfs_unavail_pool() 145 zpool_close(zhp); in zfs_unavail_pool() 306 zpool_get_name(zhp), path, in zfs_process_add() 730 zfs_iter_vdev(zhp, nvl, data); in zfs_iter_pool() 756 zpool_close(zhp); in zfs_iter_pool() 1088 zpool_close(zhp); in zfsdle_vdev_online() 1101 zpool_close(zhp); in zfsdle_vdev_online() 1105 zpool_close(zhp); in zfsdle_vdev_online() 1199 zpool_close(zhp); in zfsdle_vdev_online() [all …]
|
/freebsd/sys/contrib/openzfs/cmd/zfs/ |
H A D | zfs_main.c | 759 if (zhp == NULL) in zfs_mount_and_share() 767 zfs_close(zhp); in zfs_mount_and_share() 798 zfs_close(zhp); in zfs_mount_and_share() 902 zfs_close(zhp); in zfs_do_clone() 1407 zfs_close(zhp); in destroy_check_dependent() 1489 zfs_close(zhp); in destroy_callback() 1531 zfs_close(zhp); in destroy_print_cb() 1576 zfs_close(zhp); in snapshot_to_nvl_cb() 1603 zfs_close(zhp); in gather_snapshots() 1857 zhp = NULL; in zfs_do_destroy() [all …]
|
H A D | zfs_iter.c | 83 zph = zfs_get_pool_handle(zhp); in zfs_include_snapshots() 92 zfs_callback(zfs_handle_t *zhp, void *data) in zfs_callback() argument 99 if ((zfs_get_type(zhp) & cb->cb_types) || in zfs_callback() 104 node->zn_handle = zhp; in zfs_callback() 111 zfs_prune_proplist(zhp, in zfs_callback() 166 zfs_close(zhp); in zfs_callback() 501 zfs_handle_t *zhp = NULL; in zfs_for_each() local 517 zhp = zfs_path_to_zhandle(g_zfs, argv[i], in zfs_for_each() 520 zhp = zfs_open(g_zfs, argv[i], argtype); in zfs_for_each() 522 if (zhp != NULL) in zfs_for_each() [all …]
|
/freebsd/sys/contrib/openzfs/cmd/zpool/ |
H A D | zpool_main.c | 768 if (zhp == NULL) in zpool_do_initialize() 790 zpool_close(zhp); in zpool_do_initialize() 1149 zpool_close(zhp); in zpool_do_add() 1171 zpool_close(zhp); in zpool_do_add() 1278 zpool_close(zhp); in zpool_do_add() 1389 zpool_close(zhp); in zpool_do_remove() 2029 zpool_close(zhp); in zpool_do_destroy() 2272 zpool_close(zhp); in find_spare() 7971 if (zhp == NULL) in zpool_do_trim() 9308 print_status_config(zhp, cbp, zpool_get_name(zhp), nvroot, 0, in status_callback() [all …]
|
H A D | zpool_iter.c | 83 add_pool(zpool_handle_t *zhp, void *data) in add_pool() argument 89 node->zn_handle = zhp; in add_pool() 93 zpool_expand_proplist(zhp, zlp->zl_proplist, in add_pool() 95 zpool_close(zhp); in add_pool() 101 zpool_close(zhp); in add_pool() 145 zpool_handle_t *zhp; in pool_list_get() local 147 if ((zhp = zpool_open_canfail(g_zfs, argv[i])) != in pool_list_get() 149 if (add_pool(zhp, zlp) != 0) in pool_list_get() 201 search.zn_handle = zhp; in pool_list_remove() 552 zpool_handle_t *zhp = zhp_data; in for_each_vdev_run_cb() local [all …]
|
H A D | zpool_util.h | 59 nvlist_t *make_root_vdev(zpool_handle_t *zhp, nvlist_t *props, int force, 62 nvlist_t *split_mirror_vdev(zpool_handle_t *zhp, char *newname, 72 int for_each_vdev(zpool_handle_t *zhp, pool_vdev_iter_f func, void *data); 138 void after_zpool_upgrade(zpool_handle_t *zhp); 141 int zpool_power(zpool_handle_t *zhp, char *vdev, boolean_t turn_on); 142 int zpool_power_current_state(zpool_handle_t *zhp, char *vdev);
|
/freebsd/sys/contrib/openzfs/cmd/zpool/os/freebsd/ |
H A D | zpool_vdev_os.c | 108 after_zpool_upgrade(zpool_handle_t *zhp) in after_zpool_upgrade() argument 112 if (zpool_get_prop(zhp, ZPOOL_PROP_BOOTFS, bootfs, in after_zpool_upgrade() 118 "details.\n"), zpool_get_name(zhp)); in after_zpool_upgrade() 129 zpool_power_current_state(zpool_handle_t *zhp, char *vdev) in zpool_power_current_state() argument 132 (void) zhp; in zpool_power_current_state() 139 zpool_power(zpool_handle_t *zhp, char *vdev, boolean_t turn_on) in zpool_power() argument 142 (void) zhp; in zpool_power()
|
/freebsd/sys/contrib/openzfs/lib/libzfs/os/linux/ |
H A D | libzfs_mount_os.c | 272 if (zfs_prop_get(zhp, zpt, context, sizeof (context), in zfs_selinux_setcontext() 280 zfs_adjust_mount_options(zfs_handle_t *zhp, const char *mntpoint, in zfs_adjust_mount_options() argument 296 zfs_selinux_setcontext(zhp, ZFS_PROP_SELINUX_FSCONTEXT, in zfs_adjust_mount_options() 298 zfs_selinux_setcontext(zhp, ZFS_PROP_SELINUX_DEFCONTEXT, in zfs_adjust_mount_options() 300 zfs_selinux_setcontext(zhp, in zfs_adjust_mount_options() 332 const char *src = zfs_get_name(zhp); in do_mount() 345 zfs_adjust_mount_options(zhp, mntpt, myopts, NULL); in do_mount() 384 do_unmount(zfs_handle_t *zhp, const char *mntpt, int flags) in do_unmount() argument 386 (void) zhp; in do_unmount() 420 zpool_disable_datasets_os(zpool_handle_t *zhp, boolean_t force) in zpool_disable_datasets_os() argument [all …]
|
/freebsd/sys/contrib/openzfs/cmd/ |
H A D | mount_zfs.c | 151 zfs_handle_t *zhp; in main() local 264 if ((zhp = zfs_open(g_zfs, dataset, in main() 278 if (zfs_get_type(zhp) == ZFS_TYPE_SNAPSHOT) in main() 281 (void) zfs_prop_get(zhp, ZFS_PROP_MOUNTPOINT, prop, in main() 289 zfs_version = zfs_prop_get_int(zhp, ZFS_PROP_VERSION); in main() 293 zfs_close(zhp); in main() 315 zfs_close(zhp); in main() 327 zfs_close(zhp); in main() 342 error = zfs_mount_at(zhp, mntopts, mntflags, mntpoint); in main() 346 zfs_close(zhp); in main() [all …]
|
/freebsd/cddl/usr.sbin/zfsd/ |
H A D | case_file.cc | 526 if (zhp == NULL) { in ActivateSpare() 531 poolname = zpool_get_name(zhp); in ActivateSpare() 532 config = zpool_get_config(zhp, NULL); in ActivateSpare() 873 m_vdevName = vdev.Name(zhp, false); in CaseFile() 1029 if (zhp == NULL in OnGracePeriodEnded() 1084 Vdev vd(zhp, CaseVdev(zhp)); in BeingReplacedBy() 1134 if (zhp == NULL) { in Replace() 1139 poolname = zpool_get_name(zhp); in Replace() 1140 Vdev vd(zhp, CaseVdev(zhp)); in Replace() 1141 Vdev replaced(BeingReplacedBy(zhp)); in Replace() [all …]
|
/freebsd/sys/contrib/openzfs/tests/zfs-tests/cmd/ |
H A D | send_doall.c | 52 zfs_handle_t *zhp; in main() local 72 zhp = zfs_open(zhdl, fsname, ZFS_TYPE_FILESYSTEM); in main() 73 if (zhp == NULL) in main() 78 error = zfs_send(zhp, NULL, tosnap, &flags, in main() 81 zfs_close(zhp); in main()
|
/freebsd/sys/contrib/openzfs/lib/libzfs/os/freebsd/ |
H A D | libzfs_zmount.c | 74 do_mount(zfs_handle_t *zhp, const char *mntpt, const char *opts, int flags) in do_mount() argument 79 const char *spec = zfs_get_name(zhp); in do_mount() 110 do_unmount(zfs_handle_t *zhp, const char *mntpt, int flags) in do_unmount() argument 112 (void) zhp; in do_unmount() 126 zpool_disable_datasets_os(zpool_handle_t *zhp, boolean_t force) in zpool_disable_datasets_os() argument 128 (void) zhp, (void) force; in zpool_disable_datasets_os()
|
H A D | libzfs_compat.c | 256 zpool_label_disk(libzfs_handle_t *hdl, zpool_handle_t *zhp, const char *name) in zpool_label_disk() argument 258 (void) hdl, (void) zhp, (void) name; in zpool_label_disk() 280 zfs_jail(zfs_handle_t *zhp, int jailid, int attach) in zfs_jail() argument 282 libzfs_handle_t *hdl = zhp->zfs_hdl; in zfs_jail() 289 dgettext(TEXT_DOMAIN, "cannot jail '%s'"), zhp->zfs_name); in zfs_jail() 292 dgettext(TEXT_DOMAIN, "cannot unjail '%s'"), zhp->zfs_name); in zfs_jail() 295 switch (zhp->zfs_type) { in zfs_jail() 321 assert(zhp->zfs_type == ZFS_TYPE_FILESYSTEM); in zfs_jail() 323 (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name)); in zfs_jail()
|
/freebsd/sys/contrib/openzfs/cmd/zinject/ |
H A D | translate.c | 135 zfs_handle_t *zhp; in object_from_path() local 137 if ((zhp = zfs_open(g_zfs, dataset, ZFS_TYPE_DATASET)) == NULL) in object_from_path() 140 record->zi_objset = zfs_prop_get_int(zhp, ZFS_PROP_OBJSETID); in object_from_path() 143 zfs_close(zhp); in object_from_path() 336 zpool_handle_t *zhp; in translate_device() local 344 if ((zhp = zpool_open(g_zfs, pool)) == NULL) in translate_device() 349 tgt = zpool_find_vdev(zhp, device, &isspare, &iscache, NULL); in translate_device() 354 zpool_close(zhp); in translate_device() 396 zpool_close(zhp); in translate_device()
|