Lines Matching defs:zhp
563 zpool_collect_leaves(zpool_handle_t *zhp, nvlist_t *nvroot, nvlist_t *res)
573 char *path = zpool_vdev_name(g_zfs, zhp, nvroot,
585 zpool_collect_leaves(zhp, child[i], res);
640 vdev_name_to_path(zpool_handle_t *zhp, char *vdev)
642 nvlist_t *vdev_nv = zpool_find_vdev(zhp, vdev, NULL, NULL, NULL);
650 zpool_power_on(zpool_handle_t *zhp, char *vdev)
652 return (zpool_power(zhp, vdev, B_TRUE));
656 zpool_power_on_and_disk_wait(zpool_handle_t *zhp, char *vdev)
660 rc = zpool_power_on(zhp, vdev);
664 zpool_disk_wait(vdev_name_to_path(zhp, vdev));
670 zpool_power_on_pool_and_wait_for_devices(zpool_handle_t *zhp)
677 FOR_EACH_REAL_LEAF_VDEV(zhp, nv) {
680 rc = zpool_power_on(zhp, (char *)path);
692 FOR_EACH_REAL_LEAF_VDEV(zhp, nv) {
701 zpool_power_off(zpool_handle_t *zhp, char *vdev)
703 return (zpool_power(zhp, vdev, B_FALSE));
795 zpool_handle_t *zhp;
871 zhp = zpool_open(g_zfs, poolname);
872 if (zhp == NULL)
878 nvlist_t *config = zpool_get_config(zhp, NULL);
881 zpool_collect_leaves(zhp, nvroot, vdevs);
889 err = zpool_initialize_wait(zhp, cmd_type, vdevs);
891 err = zpool_initialize(zhp, cmd_type, vdevs);
894 zpool_close(zhp);
903 print_vdev_tree(zpool_handle_t *zhp, const char *name, nvlist_t *nv, int indent,
942 vname = zpool_vdev_name(g_zfs, zhp, child[c], name_flags);
943 print_vdev_tree(zhp, vname, child[c], indent + 2, "",
1024 find_spare(zpool_handle_t *zhp, void *data)
1029 config = zpool_get_config(zhp, NULL);
1034 cbp->cb_zhp = zhp;
1038 zpool_close(zhp);
1105 fill_pool_info(nvlist_t *list, zpool_handle_t *zhp, boolean_t addtype,
1108 nvlist_t *config = zpool_get_config(zhp, NULL);
1112 fnvlist_add_string(list, "name", zpool_get_name(zhp));
1115 fnvlist_add_string(list, "state", zpool_get_state_str(zhp));
1141 used_by_other(zpool_handle_t *zhp, nvlist_t *nvdev, nvlist_t *list)
1148 zpool_get_name(zhp)) != 0) {
1157 fill_vdev_info(nvlist_t *list, zpool_handle_t *zhp, char *name,
1169 if (strcmp(name, zpool_get_name(zhp)) != 0)
1174 nvdev = zpool_find_vdev(zhp, _name, NULL, &l2c, NULL);
1222 nvdev_parent = zpool_find_parent_vdev(zhp,
1412 zpool_handle_t *zhp;
1505 if ((zhp = zpool_open(g_zfs, poolname)) == NULL)
1508 if ((config = zpool_get_config(zhp, NULL)) == NULL) {
1511 zpool_close(zhp);
1521 intval = zpool_get_prop_int(zhp, ZPOOL_PROP_ASHIFT, &src);
1530 nvroot = make_root_vdev(zhp, props, !check_inuse,
1533 zpool_close(zhp);
1548 "configuration:\n\n"), zpool_get_name(zhp));
1551 print_vdev_tree(zhp, poolname, poolnvroot, 0, "",
1553 print_vdev_tree(zhp, NULL, nvroot, 0, "", name_flags);
1557 print_vdev_tree(zhp, "dedup", poolnvroot, 0,
1559 print_vdev_tree(zhp, NULL, nvroot, 0,
1562 print_vdev_tree(zhp, "dedup", nvroot, 0,
1567 print_vdev_tree(zhp, "special", poolnvroot, 0,
1569 print_vdev_tree(zhp, NULL, nvroot, 0,
1572 print_vdev_tree(zhp, "special", nvroot, 0,
1577 print_vdev_tree(zhp, "logs", poolnvroot, 0,
1579 print_vdev_tree(zhp, NULL, nvroot, 0,
1582 print_vdev_tree(zhp, "logs", nvroot, 0,
1635 ret = (zpool_add(zhp, nvroot, check_ashift) != 0);
1640 zpool_close(zhp);
1655 zpool_handle_t *zhp = NULL;
1695 if ((zhp = zpool_open(g_zfs, poolname)) == NULL)
1699 zpool_close(zhp);
1709 if (zpool_vdev_remove_cancel(zhp) != 0)
1726 if (zpool_vdev_indirect_size(zhp, argv[i],
1743 if (zpool_vdev_remove(zhp, argv[i]) != 0)
1749 ret = zpool_wait(zhp, ZPOOL_WAIT_REMOVE);
1751 zpool_close(zhp);
2337 zpool_handle_t *zhp;
2368 if ((zhp = zpool_open_canfail(g_zfs, pool)) == NULL) {
2379 if (zpool_disable_datasets(zhp, force) != 0) {
2381 "could not unmount datasets\n"), zpool_get_name(zhp));
2382 zpool_close(zhp);
2389 ret = (zpool_destroy(zhp, history_str) != 0);
2391 zpool_close(zhp);
2414 zpool_export_one(zpool_handle_t *zhp, void *data)
2425 int retval = zpool_disable_datasets(zhp, cb->force);
2434 if (zpool_export_force(zhp, history_str) != 0)
2436 } else if (zpool_export(zhp, cb->force, history_str) != 0) {
2451 zpool_handle_t *zhp = zpool_open(g_zfs, aea->aea_poolname);
2452 if (zhp != NULL) {
2453 int ret = zpool_export_one(zhp, aea->aea_cbdata);
2456 zpool_close(zhp);
2469 zpool_export_one_async(zpool_handle_t *zhp, void *data)
2474 /* save pool name since zhp will go out of scope */
2475 aea->aea_poolname = strdup(zpool_get_name(zhp));
2571 max_width(zpool_handle_t *zhp, nvlist_t *nv, int depth, int max,
2577 char *name = zpool_vdev_name(g_zfs, zhp, nv, name_flags);
2587 max = MAX(max_width(zhp, child[c], depth + 2,
2877 print_status_config(zpool_handle_t *zhp, status_cbdata_t *cb, const char *name,
2985 switch (zpool_power_current_state(zhp, (char *)
3052 zpool_get_name(zhp)) == 0)
3124 root = fnvlist_lookup_nvlist(zpool_get_config(zhp, NULL),
3157 zpool_print_cmd(cb->vcdl, zpool_get_name(zhp), path);
3190 vname = zpool_vdev_name(g_zfs, zhp, child[c],
3192 print_status_config(zhp, cb, vname, child[c], depth + 2,
3323 print_class_vdevs(zpool_handle_t *zhp, status_cbdata_t *cb, nvlist_t *nv,
3330 assert(zhp != NULL || !cb->cb_verbose);
3363 char *name = zpool_vdev_name(g_zfs, zhp, child[c],
3366 print_status_config(zhp, cb, name, child[c], 2,
3811 zpool_handle_t *zhp;
3894 if ((zhp = zpool_open_canfail(g_zfs, name)) == NULL)
3905 if (zpool_get_state(zhp) != POOL_STATE_UNAVAIL &&
3907 ms_status = zpool_enable_datasets(zhp, mntopts, 0, mntthreads);
3917 zpool_close(zhp);
4089 name_or_guid_exists(zpool_handle_t *zhp, void *data)
4092 nvlist_t *config = zpool_get_config(zhp, NULL);
4113 zpool_close(zhp);
4135 zpool_handle_t *zhp;
4182 if ((zhp = zpool_open(g_zfs, pool)) == NULL) {
4193 err = (zpool_discard_checkpoint(zhp) != 0);
4195 err = zpool_wait(zhp, ZPOOL_WAIT_CKPT_DISCARD);
4197 err = (zpool_checkpoint(zhp) != 0);
4200 zpool_close(zhp);
4219 zpool_handle_t *zhp;
4263 if ((zhp = zpool_open(g_zfs, poolname)) == NULL)
4266 err = zpool_prefetch(zhp, type);
4268 zpool_close(zhp);
5538 print_vdev_stats(zpool_handle_t *zhp, const char *name, nvlist_t *oldnv,
5637 zpool_print_cmd(cb->vcdl, zpool_get_name(zhp), path);
5683 vname = zpool_vdev_name(g_zfs, zhp, newchild[c],
5685 ret += print_vdev_stats(zhp, vname, oldnv ? oldchild[c] : NULL,
5727 vname = zpool_vdev_name(g_zfs, zhp, newchild[c],
5729 ret += print_vdev_stats(zhp, vname, oldnv ?
5758 vname = zpool_vdev_name(g_zfs, zhp, newchild[c],
5760 ret += print_vdev_stats(zhp, vname, oldnv ? oldchild[c]
5770 refresh_iostat(zpool_handle_t *zhp, void *data)
5778 if (zpool_refresh_stats(zhp, &missing) != 0)
5782 pool_list_remove(cb->cb_list, zhp);
5791 print_iostat(zpool_handle_t *zhp, void *data)
5798 newconfig = zpool_get_config(zhp, &oldconfig);
5812 ret = print_vdev_stats(zhp, zpool_get_name(zhp), oldnvroot, newnvroot,
5850 get_namewidth(zpool_handle_t *zhp, int min_width, int flags, boolean_t verbose)
5855 if ((config = zpool_get_config(zhp, NULL)) != NULL) {
5858 size_t poolname_len = strlen(zpool_get_name(zhp));
5863 max_width(zhp, nvroot, 0, min_width, flags));
5960 get_stat_flags_cb(zpool_handle_t *zhp, void *data)
5967 config = zpool_get_config(zhp, NULL);
6030 zpool_handle_t *zhp = zhp_data;
6035 return (guid == zpool_vdev_path_to_guid(zhp, cb->cb_names[0]));
6042 is_vdev(zpool_handle_t *zhp, void *cb_data)
6044 return (for_each_vdev(zhp, is_vdev_cb, cb_data));
6090 is_pool_cb(zpool_handle_t *zhp, void *data)
6093 if (strcmp(name, zpool_get_name(zhp)) == 0)
6300 get_namewidth_iostat(zpool_handle_t *zhp, void *data)
6309 width = get_namewidth(zhp, cb->cb_namewidth,
6816 collect_pool(zpool_handle_t *zhp, list_cbdata_t *cb)
6836 fill_pool_info(item, zhp, B_TRUE, cb->cb_json_as_int);
6861 if (zpool_get_prop(zhp, pl->pl_prop, property,
6871 zpool_prop_get_feature(zhp, pl->pl_user_prop, property,
6876 zpool_get_userprop(zhp, pl->pl_user_prop, property,
6915 zpool_get_config(zhp, NULL),
6921 fnvlist_add_nvlist(d, zpool_get_name(zhp),
6999 collect_list_stats(zpool_handle_t *zhp, const char *name, nvlist_t *nv,
7033 fill_vdev_info(ent, zhp, (char *)name, B_FALSE,
7130 vname = zpool_vdev_name(g_zfs, zhp, child[c],
7134 collect_list_stats(zhp, vname, child[c], cb, depth + 2,
7137 collect_list_stats(zhp, vname, child[c], cb, depth + 2,
7178 vname = zpool_vdev_name(g_zfs, zhp, child[c],
7180 collect_list_stats(zhp, vname, child[c], cb, depth + 2,
7200 vname = zpool_vdev_name(g_zfs, zhp, child[c],
7202 collect_list_stats(zhp, vname, child[c], cb, depth + 2,
7222 vname = zpool_vdev_name(g_zfs, zhp, child[c],
7224 collect_list_stats(zhp, vname, child[c], cb, depth + 2,
7245 list_callback(zpool_handle_t *zhp, void *data)
7250 const char *pool_name = zpool_get_name(zhp);
7254 collect_pool(zhp, cbp);
7258 config = zpool_get_config(zhp, NULL);
7275 collect_list_stats(zhp, NULL, nvroot, cbp, 0, B_FALSE, nvdevs);
7295 get_namewidth_list(zpool_handle_t *zhp, void *data)
7300 width = get_namewidth(zhp, cb->cb_namewidth,
7504 zpool_handle_t *zhp;
7580 if ((zhp = zpool_open(g_zfs, poolname)) == NULL) {
7585 if (zpool_get_config(zhp, NULL) == NULL) {
7588 zpool_close(zhp);
7599 intval = zpool_get_prop_int(zhp, ZPOOL_PROP_ASHIFT, &src);
7607 nvroot = make_root_vdev(zhp, props, force, B_FALSE, replacing, B_FALSE,
7610 zpool_close(zhp);
7615 ret = zpool_vdev_attach(zhp, old_disk, new_disk, nvroot, replacing,
7627 ret = zpool_wait(zhp, activity);
7632 zpool_close(zhp);
7691 zpool_handle_t *zhp;
7722 if ((zhp = zpool_open(g_zfs, poolname)) == NULL)
7725 ret = zpool_vdev_detach(zhp, path);
7727 zpool_close(zhp);
7764 zpool_handle_t *zhp;
7854 if ((zhp = zpool_open(g_zfs, srcpool)) == NULL) {
7859 config = split_mirror_vdev(zhp, newpool, props, flags, argc, argv);
7875 zpool_close(zhp);
7887 if ((zhp = zpool_open_canfail(g_zfs, newpool)) == NULL) {
7899 if (zpool_get_state(zhp) != POOL_STATE_UNAVAIL) {
7900 ms_status = zpool_enable_datasets(zhp, mntopts, 0,
7913 zpool_close(zhp);
7931 zpool_handle_t *zhp;
7975 if ((zhp = zpool_open(g_zfs, poolname)) == NULL) {
7987 rc = zpool_power_on_and_disk_wait(zhp, argv[i]);
7996 nvlist_t *tgt = zpool_find_vdev(zhp, argv[i], &avail_spare,
8007 if ((rc = zpool_vdev_online(zhp, argv[i], flags,
8041 zpool_close(zhp);
8062 zpool_handle_t *zhp;
8121 if ((zhp = zpool_open(g_zfs, poolname)) == NULL) {
8128 uint64_t guid = zpool_vdev_path_to_guid(zhp, argv[i]);
8135 ret = zpool_power_off(zhp, argv[i]);
8141 zpool_vdev_set_removed_state(zhp, guid, VDEV_AUX_NONE);
8152 if (guid == 0 || zpool_vdev_fault(zhp, guid, aux) != 0)
8155 if (zpool_vdev_offline(zhp, argv[i], istmp) != 0)
8160 zpool_close(zhp);
8181 zpool_handle_t *zhp;
8250 if ((zhp = zpool_open_canfail(g_zfs, pool)) == NULL) {
8257 zpool_power_on_pool_and_wait_for_devices(zhp);
8259 zpool_power_on_and_disk_wait(zhp, device);
8263 if (zpool_clear(zhp, device, policy) != 0)
8266 zpool_close(zhp);
8284 zpool_handle_t *zhp;
8322 if ((zhp = zpool_open(g_zfs, poolname)) == NULL)
8325 ret = zpool_set_guid(zhp, guidp);
8327 zpool_close(zhp);
8373 zpool_has_checkpoint(zpool_handle_t *zhp)
8377 config = zpool_get_config(zhp, NULL);
8399 scrub_callback(zpool_handle_t *zhp, void *data)
8407 if (zpool_get_state(zhp) == POOL_STATE_UNAVAIL) {
8409 "currently unavailable\n"), zpool_get_name(zhp));
8413 err = zpool_scan(zhp, cb->cb_type, cb->cb_scrub_cmd);
8415 if (err == 0 && zpool_has_checkpoint(zhp) &&
8419 zpool_get_name(zhp));
8426 wait_callback(zpool_handle_t *zhp, void *data)
8429 return (zpool_wait(zhp, *act));
8678 zpool_handle_t *zhp = zpool_open(g_zfs, poolname);
8679 if (zhp == NULL)
8691 nvlist_t *config = zpool_get_config(zhp, NULL);
8694 zpool_collect_leaves(zhp, nvroot, vdevs);
8703 int error = zpool_trim(zhp, cmd_type, vdevs, &trim_flags);
8706 zpool_close(zhp);
9040 print_rebuild_status(zpool_handle_t *zhp, nvlist_t *nvroot)
9055 char *name = zpool_vdev_name(g_zfs, zhp,
9141 vdev_stats_nvlist(zpool_handle_t *zhp, status_cbdata_t *cb, nvlist_t *nv,
9164 vname = zpool_vdev_name(g_zfs, zhp, nv,
9167 fill_vdev_info(vds, zhp, vname, B_FALSE, cb->cb_json_as_int);
9175 used_by_other(zhp, nv, vds);
9244 switch (zpool_power_current_state(zhp, (char *)
9300 zpool_nvlist_cmd(cb->vcdl, zpool_get_name(zhp),
9381 vdev_stats_nvlist(zhp, cb, child[c], depth + 2, isspare,
9384 vdev_stats_nvlist(zhp, cb, child[c], depth + 2, isspare,
9399 class_vdevs_nvlist(zpool_handle_t *zhp, status_cbdata_t *cb, nvlist_t *nv,
9409 assert(zhp != NULL || !cb->cb_verbose);
9419 char *name = zpool_vdev_name(g_zfs, zhp, child[c],
9440 vdev_stats_nvlist(zhp, cb, child[c], 2, B_FALSE,
9443 vdev_stats_nvlist(zhp, cb, child[c], 2, B_FALSE,
9456 l2cache_nvlist(zpool_handle_t *zhp, status_cbdata_t *cb, nvlist_t *nv,
9469 vdev_stats_nvlist(zhp, cb, l2cache[i], 2,
9472 vdev_stats_nvlist(zhp, cb, l2cache[i], 2,
9485 spares_nvlist(zpool_handle_t *zhp, status_cbdata_t *cb, nvlist_t *nv,
9498 vdev_stats_nvlist(zhp, cb, spares[i], 2, B_TRUE,
9501 vdev_stats_nvlist(zhp, cb, spares[i], 2, B_TRUE,
9514 errors_nvlist(zpool_handle_t *zhp, status_cbdata_t *cb, nvlist_t *item)
9517 nvlist_t *config = zpool_get_config(zhp, NULL);
9524 if (zpool_get_errlog(zhp, &nverrlist) == 0) {
9550 zpool_obj_to_path(zhp, dsobj, obj,
9588 dedup_stats_nvlist(zpool_handle_t *zhp, status_cbdata_t *cb, nvlist_t *item)
9599 config = zpool_get_config(zhp, NULL);
9626 cspace_prop = zpool_get_prop_int(zhp,
9682 raidz_expand_status_nvlist(zpool_handle_t *zhp, status_cbdata_t *cb,
9696 zpool_vdev_name(g_zfs, zhp,
9698 fill_vdev_info(nv, zhp, name, B_FALSE, cb->cb_json_as_int);
9744 removal_status_nvlist(zpool_handle_t *zhp, status_cbdata_t *cb,
9757 char *vdev_name = zpool_vdev_name(g_zfs, zhp,
9760 fill_vdev_info(nv, zhp, vdev_name, B_FALSE,
9791 scan_status_nvlist(zpool_handle_t *zhp, status_cbdata_t *cb,
9877 name = zpool_vdev_name(g_zfs, zhp,
9879 fill_vdev_info(nv, zhp, name, B_FALSE,
9951 print_scan_status(zpool_handle_t *zhp, nvlist_t *nvroot)
9998 print_rebuild_status(zhp, nvroot);
10010 print_removal_status(zpool_handle_t *zhp, pool_removal_stat_t *prs)
10025 config = zpool_get_config(zhp, NULL);
10031 vdev_name = zpool_vdev_name(g_zfs, zhp,
10115 print_raidz_expand_status(zpool_handle_t *zhp, pool_raidz_expand_stat_t *pres)
10125 nvlist_t *config = zpool_get_config(zhp, NULL);
10139 zpool_vdev_name(g_zfs, zhp, child[pres->pres_expanding_vdev], 0);
10235 print_error_log(zpool_handle_t *zhp)
10242 if (zpool_get_errlog(zhp, &nverrlist) != 0)
10259 zpool_obj_to_path(zhp, dsobj, obj, pathname, len);
10267 print_spares(zpool_handle_t *zhp, status_cbdata_t *cb, nvlist_t **spares,
10279 name = zpool_vdev_name(g_zfs, zhp, spares[i],
10281 print_status_config(zhp, cb, name, spares[i], 2, B_TRUE, NULL);
10287 print_l2cache(zpool_handle_t *zhp, status_cbdata_t *cb, nvlist_t **l2cache,
10299 name = zpool_vdev_name(g_zfs, zhp, l2cache[i],
10301 print_status_config(zhp, cb, name, l2cache[i], 2,
10308 print_dedup_stats(zpool_handle_t *zhp, nvlist_t *config, boolean_t literal)
10340 cspace_prop = zpool_get_prop_int(zhp, ZPOOL_PROP_DEDUPCACHED, &src);
10368 print_status_reason(zpool_handle_t *zhp, status_cbdata_t *cbp,
10407 zpool_explain_recover(zpool_get_handle(zhp),
10408 zpool_get_name(zhp), reason, zpool_get_config(zhp, NULL),
10472 zpool_explain_recover(zpool_get_handle(zhp),
10473 zpool_get_name(zhp), reason, zpool_get_config(zhp, NULL),
10532 zpool_collect_unsup_feat(zpool_get_config(zhp, NULL), status,
10544 zpool_collect_unsup_feat(zpool_get_config(zhp, NULL), status,
10696 status_callback_json(zpool_handle_t *zhp, void *data)
10713 zpool_add_propname(zhp, ZPOOL_DEDUPCACHED_PROP_NAME);
10714 reason = zpool_get_status(zhp, &msgid, &errata);
10731 fill_pool_info(item, zhp, B_FALSE, cbp->cb_json_as_int);
10732 config = zpool_get_config(zhp, NULL);
10745 print_status_reason(zhp, cbp, reason, errata, item);
10760 scan_status_nvlist(zhp, cbp, nvroot, item);
10761 removal_status_nvlist(zhp, cbp, nvroot, item);
10763 raidz_expand_status_nvlist(zhp, cbp, nvroot, item);
10764 vdev_stats_nvlist(zhp, cbp, nvroot, 0, B_FALSE, NULL, vds);
10766 class_vdevs_nvlist(zhp, cbp, nvroot,
10768 class_vdevs_nvlist(zhp, cbp, nvroot,
10770 class_vdevs_nvlist(zhp, cbp, nvroot,
10772 l2cache_nvlist(zhp, cbp, nvroot, vds);
10773 spares_nvlist(zhp, cbp, nvroot, vds);
10781 class_vdevs_nvlist(zhp, cbp, nvroot,
10783 class_vdevs_nvlist(zhp, cbp, nvroot,
10785 class_vdevs_nvlist(zhp, cbp, nvroot,
10787 l2cache_nvlist(zhp, cbp, nvroot, item);
10788 spares_nvlist(zhp, cbp, nvroot, item);
10790 dedup_stats_nvlist(zhp, cbp, item);
10791 errors_nvlist(zhp, cbp, item);
10796 fnvlist_add_nvlist(d, zpool_get_name(zhp),
10819 status_callback(zpool_handle_t *zhp, void *data)
10832 zpool_add_propname(zhp, ZPOOL_DEDUPCACHED_PROP_NAME);
10834 config = zpool_get_config(zhp, NULL);
10835 reason = zpool_get_status(zhp, &msgid, &errata);
10851 zpool_get_name(zhp));
10867 health = zpool_get_state_str(zhp);
10871 printf(" %s\n", zpool_get_name(zhp));
10878 print_status_reason(zhp, cbp, reason, errata, NULL);
10893 print_scan_status(zhp, nvroot);
10898 print_removal_status(zhp, prs);
10908 print_raidz_expand_status(zhp, pres);
10910 cbp->cb_namewidth = max_width(zhp, nvroot, 0, 0,
10939 print_status_config(zhp, cbp, zpool_get_name(zhp), nvroot, 0,
10942 print_class_vdevs(zhp, cbp, nvroot, VDEV_ALLOC_BIAS_DEDUP);
10943 print_class_vdevs(zhp, cbp, nvroot, VDEV_ALLOC_BIAS_SPECIAL);
10944 print_class_vdevs(zhp, cbp, nvroot, VDEV_ALLOC_CLASS_LOGS);
10948 print_l2cache(zhp, cbp, l2cache, nl2cache);
10952 print_spares(zhp, cbp, spares, nspares);
10967 print_error_log(zhp);
10972 print_dedup_stats(zhp, config, cbp->cb_literal);
11234 check_unsupp_fs(zfs_handle_t *zhp, void *unsupp_fs)
11236 int zfs_version = (int)zfs_prop_get_int(zhp, ZFS_PROP_VERSION);
11242 zfs_get_name(zhp), zfs_version);
11246 zfs_iter_filesystems_v2(zhp, 0, check_unsupp_fs, unsupp_fs);
11248 zfs_close(zhp);
11254 upgrade_version(zpool_handle_t *zhp, uint64_t version)
11261 config = zpool_get_config(zhp, NULL);
11266 if (zpool_get_prop(zhp, ZPOOL_PROP_COMPATIBILITY, compat,
11273 ret = zfs_iter_root(zpool_get_handle(zhp), check_unsupp_fs, &unsupp_fs);
11291 ret = zpool_upgrade(zhp, version);
11298 zpool_get_name(zhp), (u_longlong_t)oldversion);
11302 zpool_get_name(zhp), (u_longlong_t)oldversion,
11310 upgrade_enable_all(zpool_handle_t *zhp, int *countp)
11314 nvlist_t *enabled = zpool_get_features(zhp);
11317 if (zpool_get_prop(zhp, ZPOOL_PROP_COMPATIBILITY, compat,
11337 ret = zpool_set_prop(zhp, propname,
11348 zpool_get_name(zhp));
11362 upgrade_cb(zpool_handle_t *zhp, void *arg)
11370 config = zpool_get_config(zhp, NULL);
11378 ret = upgrade_version(zhp, cbp->cb_version);
11395 ret = upgrade_enable_all(zhp, &count);
11407 (void) after_zpool_upgrade(zhp);
11414 upgrade_list_older_cb(zpool_handle_t *zhp, void *arg)
11420 config = zpool_get_config(zhp, NULL);
11443 zpool_get_name(zhp));
11450 upgrade_list_disabled_cb(zpool_handle_t *zhp, void *arg)
11456 config = zpool_get_config(zhp, NULL);
11463 nvlist_t *enabled = zpool_get_features(zhp);
11496 zpool_get_name(zhp));
11517 upgrade_one(zpool_handle_t *zhp, void *data)
11524 if (strcmp("log", zpool_get_name(zhp)) == 0) {
11531 cur_version = zpool_get_prop_int(zhp, ZPOOL_PROP_VERSION, NULL);
11535 zpool_get_name(zhp), (u_longlong_t)cur_version);
11541 "using version %llu.\n\n"), zpool_get_name(zhp),
11548 ret = upgrade_version(zhp, cbp->cb_version);
11555 ret = upgrade_enable_all(zhp, &count);
11564 zpool_get_name(zhp));
11570 (void) after_zpool_upgrade(zhp);
11901 get_history_one(zpool_handle_t *zhp, void *data)
11911 (void) printf(gettext("History for '%s':\n"), zpool_get_name(zhp));
11914 if ((ret = zpool_get_history(zhp, &nvhis, &off, &eof)) != 0)
12377 get_callback_vdev(zpool_handle_t *zhp, char *vdevname, void *data)
12411 if (zpool_get_vdev_prop(zhp, vdevname, pl->pl_prop,
12422 fill_vdev_info(item, zhp, vdevname, B_TRUE,
12438 zpool_handle_t *zhp = zhp_data;
12450 if (zhp != NULL && strcmp(type, "root") == 0)
12453 vdevname = zpool_vdev_name(g_zfs, zhp, nv,
12456 (void) vdev_expand_proplist(zhp, vdevname, &cbp->cb_proplist);
12458 ret = get_callback_vdev(zhp, vdevname, data);
12466 get_callback(zpool_handle_t *zhp, void *data)
12480 fill_pool_info(pool, zhp, B_FALSE, cbp->cb_json_as_int);
12486 for_each_vdev(zhp, get_callback_vdev_cb, data);
12491 vdev_expand_proplist(zhp,
12498 get_callback_vdev(zhp,
12525 if (zpool_get_userprop(zhp, pl->pl_user_prop,
12530 zpool_get_name(zhp), cbp, pl->pl_user_prop,
12537 if (zpool_prop_get_feature(zhp,
12541 zpool_get_name(zhp), cbp,
12546 if (zpool_get_prop(zhp, pl->pl_prop, value,
12552 zpool_get_name(zhp), cbp,
12563 fill_pool_info(item, zhp, B_TRUE,
12569 zpool_get_config(zhp, NULL),
12575 const char *name = zpool_get_name(zhp);
12833 set_pool_callback(zpool_handle_t *zhp, set_cbdata_t *cb)
12844 nvlist_t *enabled = zpool_get_features(zhp);
12855 zpool_get_name(zhp));
12866 if (zpool_get_prop(zhp, ZPOOL_PROP_COMPATIBILITY,
12877 fname, zpool_get_name(zhp));
12888 fname, zpool_get_name(zhp));
12894 error = zpool_set_prop(zhp, cb->cb_propname, cb->cb_value);
12900 set_callback(zpool_handle_t *zhp, void *data)
12906 error = zpool_set_vdev_prop(zhp, *cb->cb_vdevs.cb_names,
12910 error = set_pool_callback(zhp, cb);
13111 print_wait_status_row(wait_data_t *wd, zpool_handle_t *zhp, int row)
13153 zpool_get_prop_int(zhp, ZPOOL_PROP_FREEING, NULL);
13155 config = zpool_get_config(zhp, NULL);
13236 zpool_handle_t *zhp;
13238 if ((zhp = zpool_open(g_zfs, wd->wd_poolname)) == NULL)
13247 if (zpool_refresh_stats(zhp, &missing) != 0 || missing ||
13248 zpool_props_refresh(zhp) != 0) {
13249 zpool_close(zhp);
13253 print_wait_status_row(wd, zhp, row);
13274 zpool_close(zhp);
13279 zpool_close(zhp);
13291 zpool_handle_t *zhp;
13373 if ((zhp = zpool_open(g_zfs, wd.wd_poolname)) == NULL)
13386 zpool_close(zhp);
13409 error = zpool_wait_status(zhp, i, &missing, &waited);
13420 zpool_close(zhp);
13451 zpool_handle_t *zhp;
13509 zhp = zpool_open(g_zfs, argv[0]);
13510 if (zhp == NULL)
13513 int error = zpool_ddt_prune(zhp, unit, amount);
13515 zpool_close(zhp);