Lines Matching refs:zc

70 	zfs_cmd_t zc = { 0 };  in zpool_get_all_props()  local
73 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_get_all_props()
75 if (zcmd_alloc_dst_nvlist(hdl, &zc, 0) != 0) in zpool_get_all_props()
78 while (ioctl(hdl->libzfs_fd, ZFS_IOC_POOL_GET_PROPS, &zc) != 0) { in zpool_get_all_props()
80 if (zcmd_expand_dst_nvlist(hdl, &zc) != 0) { in zpool_get_all_props()
81 zcmd_free_nvlists(&zc); in zpool_get_all_props()
85 zcmd_free_nvlists(&zc); in zpool_get_all_props()
90 if (zcmd_read_dst_nvlist(hdl, &zc, &zhp->zpool_props) != 0) { in zpool_get_all_props()
91 zcmd_free_nvlists(&zc); in zpool_get_all_props()
95 zcmd_free_nvlists(&zc); in zpool_get_all_props()
626 zfs_cmd_t zc = { 0 }; in zpool_set_prop() local
659 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_set_prop()
661 if (zcmd_write_src_nvlist(zhp->zpool_hdl, &zc, nvl) != 0) { in zpool_set_prop()
666 ret = zfs_ioctl(zhp->zpool_hdl, ZFS_IOC_POOL_SET_PROPS, &zc); in zpool_set_prop()
668 zcmd_free_nvlists(&zc); in zpool_set_prop()
1066 zfs_cmd_t zc = { 0 }; in zpool_create() local
1078 if (zcmd_write_conf_nvlist(hdl, &zc, nvroot) != 0) in zpool_create()
1112 if (zc_props && zcmd_write_src_nvlist(hdl, &zc, zc_props) != 0) in zpool_create()
1115 (void) strlcpy(zc.zc_name, pool, sizeof (zc.zc_name)); in zpool_create()
1117 if ((ret = zfs_ioctl(hdl, ZFS_IOC_POOL_CREATE, &zc)) != 0) { in zpool_create()
1119 zcmd_free_nvlists(&zc); in zpool_create()
1169 zcmd_free_nvlists(&zc); in zpool_create()
1182 zfs_cmd_t zc = { 0 }; in zpool_destroy() local
1191 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_destroy()
1192 zc.zc_history = (uint64_t)(uintptr_t)log_str; in zpool_destroy()
1194 if (zfs_ioctl(hdl, ZFS_IOC_POOL_DESTROY, &zc) != 0) { in zpool_destroy()
1226 zfs_cmd_t zc = { 0 }; in zpool_add() local
1254 if (zcmd_write_conf_nvlist(hdl, &zc, nvroot) != 0) in zpool_add()
1256 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_add()
1258 if (zfs_ioctl(hdl, ZFS_IOC_VDEV_ADD, &zc) != 0) { in zpool_add()
1319 zcmd_free_nvlists(&zc); in zpool_add()
1332 zfs_cmd_t zc = { 0 }; in zpool_export_common() local
1338 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_export_common()
1339 zc.zc_cookie = force; in zpool_export_common()
1340 zc.zc_guid = hardforce; in zpool_export_common()
1341 zc.zc_history = (uint64_t)(uintptr_t)log_str; in zpool_export_common()
1343 if (zfs_ioctl(zhp->zpool_hdl, ZFS_IOC_POOL_EXPORT, &zc) != 0) { in zpool_export_common()
1603 zfs_cmd_t zc = { 0 }; in zpool_import_props() local
1640 if (zcmd_write_src_nvlist(hdl, &zc, props) != 0) { in zpool_import_props()
1647 (void) strlcpy(zc.zc_name, thename, sizeof (zc.zc_name)); in zpool_import_props()
1650 &zc.zc_guid) == 0); in zpool_import_props()
1652 if (zcmd_write_conf_nvlist(hdl, &zc, config) != 0) { in zpool_import_props()
1653 zcmd_free_nvlists(&zc); in zpool_import_props()
1656 if (zcmd_alloc_dst_nvlist(hdl, &zc, zc.zc_nvlist_conf_size * 2) != 0) { in zpool_import_props()
1657 zcmd_free_nvlists(&zc); in zpool_import_props()
1661 zc.zc_cookie = flags; in zpool_import_props()
1662 while ((ret = zfs_ioctl(hdl, ZFS_IOC_POOL_IMPORT, &zc)) != 0 && in zpool_import_props()
1664 if (zcmd_expand_dst_nvlist(hdl, &zc) != 0) { in zpool_import_props()
1665 zcmd_free_nvlists(&zc); in zpool_import_props()
1672 (void) zcmd_read_dst_nvlist(hdl, &zc, &nv); in zpool_import_props()
1674 zcmd_free_nvlists(&zc); in zpool_import_props()
1790 zfs_cmd_t zc = { 0 }; in zpool_scan() local
1794 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_scan()
1795 zc.zc_cookie = func; in zpool_scan()
1797 if (zfs_ioctl(hdl, ZFS_IOC_POOL_SCAN, &zc) == 0 || in zpool_scan()
1803 dgettext(TEXT_DOMAIN, "cannot scrub %s"), zc.zc_name); in zpool_scan()
1807 zc.zc_name); in zpool_scan()
2332 zfs_cmd_t zc = { 0 }; in zpool_vdev_online() local
2346 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_vdev_online()
2351 verify(nvlist_lookup_uint64(tgt, ZPOOL_CONFIG_GUID, &zc.zc_guid) == 0); in zpool_vdev_online()
2381 zc.zc_cookie = VDEV_STATE_ONLINE; in zpool_vdev_online()
2382 zc.zc_obj = flags; in zpool_vdev_online()
2384 if (zfs_ioctl(hdl, ZFS_IOC_VDEV_SET_STATE, &zc) != 0) { in zpool_vdev_online()
2394 *newstate = zc.zc_cookie; in zpool_vdev_online()
2404 zfs_cmd_t zc = { 0 }; in zpool_vdev_offline() local
2413 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_vdev_offline()
2418 verify(nvlist_lookup_uint64(tgt, ZPOOL_CONFIG_GUID, &zc.zc_guid) == 0); in zpool_vdev_offline()
2423 zc.zc_cookie = VDEV_STATE_OFFLINE; in zpool_vdev_offline()
2424 zc.zc_obj = istmp ? ZFS_OFFLINE_TEMPORARY : 0; in zpool_vdev_offline()
2426 if (zfs_ioctl(hdl, ZFS_IOC_VDEV_SET_STATE, &zc) == 0) in zpool_vdev_offline()
2454 zfs_cmd_t zc = { 0 }; in zpool_vdev_fault() local
2461 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_vdev_fault()
2462 zc.zc_guid = guid; in zpool_vdev_fault()
2463 zc.zc_cookie = VDEV_STATE_FAULTED; in zpool_vdev_fault()
2464 zc.zc_obj = aux; in zpool_vdev_fault()
2466 if (ioctl(hdl->libzfs_fd, ZFS_IOC_VDEV_SET_STATE, &zc) == 0) in zpool_vdev_fault()
2489 zfs_cmd_t zc = { 0 }; in zpool_vdev_degrade() local
2496 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_vdev_degrade()
2497 zc.zc_guid = guid; in zpool_vdev_degrade()
2498 zc.zc_cookie = VDEV_STATE_DEGRADED; in zpool_vdev_degrade()
2499 zc.zc_obj = aux; in zpool_vdev_degrade()
2501 if (ioctl(hdl->libzfs_fd, ZFS_IOC_VDEV_SET_STATE, &zc) == 0) in zpool_vdev_degrade()
2543 zfs_cmd_t zc = { 0 }; in zpool_vdev_attach() local
2563 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_vdev_attach()
2574 verify(nvlist_lookup_uint64(tgt, ZPOOL_CONFIG_GUID, &zc.zc_guid) == 0); in zpool_vdev_attach()
2575 zc.zc_cookie = replacing; in zpool_vdev_attach()
2607 if (zcmd_write_conf_nvlist(hdl, &zc, nvroot) != 0) in zpool_vdev_attach()
2610 ret = zfs_ioctl(hdl, ZFS_IOC_VDEV_ATTACH, &zc); in zpool_vdev_attach()
2612 zcmd_free_nvlists(&zc); in zpool_vdev_attach()
2707 zfs_cmd_t zc = { 0 }; in zpool_vdev_detach() local
2716 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_vdev_detach()
2727 verify(nvlist_lookup_uint64(tgt, ZPOOL_CONFIG_GUID, &zc.zc_guid) == 0); in zpool_vdev_detach()
2729 if (zfs_ioctl(hdl, ZFS_IOC_VDEV_DETACH, &zc) == 0) in zpool_vdev_detach()
2805 zfs_cmd_t zc = { 0 }; in zpool_vdev_split() local
2966 zc.zc_cookie = ZPOOL_EXPORT_AFTER_SPLIT; in zpool_vdev_split()
2967 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_vdev_split()
2968 (void) strlcpy(zc.zc_string, newname, sizeof (zc.zc_string)); in zpool_vdev_split()
2969 if (zcmd_write_conf_nvlist(hdl, &zc, newconfig) != 0) in zpool_vdev_split()
2971 if (zc_props != NULL && zcmd_write_src_nvlist(hdl, &zc, zc_props) != 0) in zpool_vdev_split()
2974 if (zfs_ioctl(hdl, ZFS_IOC_VDEV_SPLIT, &zc) != 0) { in zpool_vdev_split()
2990 zcmd_free_nvlists(&zc); in zpool_vdev_split()
3016 zfs_cmd_t zc = { 0 }; in zpool_vdev_remove() local
3026 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_vdev_remove()
3047 verify(nvlist_lookup_uint64(tgt, ZPOOL_CONFIG_GUID, &zc.zc_guid) == 0); in zpool_vdev_remove()
3049 if (zfs_ioctl(hdl, ZFS_IOC_VDEV_REMOVE, &zc) == 0) in zpool_vdev_remove()
3061 zfs_cmd_t zc = { 0 }; in zpool_clear() local
3079 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_clear()
3093 &zc.zc_guid) == 0); in zpool_clear()
3097 zc.zc_cookie = policy.zrp_request; in zpool_clear()
3099 if (zcmd_alloc_dst_nvlist(hdl, &zc, zhp->zpool_config_size * 2) != 0) in zpool_clear()
3102 if (zcmd_write_src_nvlist(hdl, &zc, rewindnvl) != 0) in zpool_clear()
3105 while ((error = zfs_ioctl(hdl, ZFS_IOC_CLEAR, &zc)) != 0 && in zpool_clear()
3107 if (zcmd_expand_dst_nvlist(hdl, &zc) != 0) { in zpool_clear()
3108 zcmd_free_nvlists(&zc); in zpool_clear()
3117 (void) zcmd_read_dst_nvlist(hdl, &zc, &nvi); in zpool_clear()
3118 zpool_rewind_exclaim(hdl, zc.zc_name, in zpool_clear()
3123 zcmd_free_nvlists(&zc); in zpool_clear()
3127 zcmd_free_nvlists(&zc); in zpool_clear()
3137 zfs_cmd_t zc = { 0 }; in zpool_vdev_clear() local
3145 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_vdev_clear()
3146 zc.zc_guid = guid; in zpool_vdev_clear()
3147 zc.zc_cookie = ZPOOL_NO_REWIND; in zpool_vdev_clear()
3149 if (ioctl(hdl->libzfs_fd, ZFS_IOC_CLEAR, &zc) == 0) in zpool_vdev_clear()
3163 zfs_cmd_t zc = { 0 }; in zpool_reguid() local
3168 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_reguid()
3169 if (zfs_ioctl(hdl, ZFS_IOC_POOL_REGUID, &zc) == 0) in zpool_reguid()
3181 zfs_cmd_t zc = { 0 }; in zpool_reopen() local
3189 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_reopen()
3190 if (zfs_ioctl(hdl, ZFS_IOC_POOL_REOPEN, &zc) == 0) in zpool_reopen()
3263 zfs_cmd_t zc = { 0 }; in set_path() local
3265 (void) strncpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in set_path()
3266 (void) strncpy(zc.zc_value, path, sizeof (zc.zc_value)); in set_path()
3268 &zc.zc_guid) == 0); in set_path()
3270 (void) ioctl(zhp->zpool_hdl->libzfs_fd, ZFS_IOC_VDEV_SETPATH, &zc); in set_path()
3414 zfs_cmd_t zc = { 0 }; in zpool_get_errlog() local
3428 if ((zc.zc_nvlist_dst = (uintptr_t)zfs_alloc(zhp->zpool_hdl, in zpool_get_errlog()
3431 zc.zc_nvlist_dst_size = count; in zpool_get_errlog()
3432 (void) strcpy(zc.zc_name, zhp->zpool_name); in zpool_get_errlog()
3435 &zc) != 0) { in zpool_get_errlog()
3436 free((void *)(uintptr_t)zc.zc_nvlist_dst); in zpool_get_errlog()
3440 count = zc.zc_nvlist_dst_size; in zpool_get_errlog()
3445 zc.zc_nvlist_dst = (uintptr_t)dst; in zpool_get_errlog()
3461 zb = ((zbookmark_phys_t *)(uintptr_t)zc.zc_nvlist_dst) + in zpool_get_errlog()
3462 zc.zc_nvlist_dst_size; in zpool_get_errlog()
3463 count -= zc.zc_nvlist_dst_size; in zpool_get_errlog()
3499 free((void *)(uintptr_t)zc.zc_nvlist_dst); in zpool_get_errlog()
3503 free((void *)(uintptr_t)zc.zc_nvlist_dst); in zpool_get_errlog()
3513 zfs_cmd_t zc = { 0 }; in zpool_upgrade() local
3516 (void) strcpy(zc.zc_name, zhp->zpool_name); in zpool_upgrade()
3517 zc.zc_cookie = new_version; in zpool_upgrade()
3519 if (zfs_ioctl(hdl, ZFS_IOC_POOL_UPGRADE, &zc) != 0) in zpool_upgrade()
3539 zfs_cmd_t zc = { 0 }; in zpool_log_history() local
3545 err = zcmd_write_src_nvlist(hdl, &zc, args); in zpool_log_history()
3547 err = ioctl(hdl->libzfs_fd, ZFS_IOC_LOG_HISTORY, &zc); in zpool_log_history()
3549 zcmd_free_nvlists(&zc); in zpool_log_history()
3565 zfs_cmd_t zc = { 0 }; in get_history() local
3568 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in get_history()
3570 zc.zc_history = (uint64_t)(uintptr_t)buf; in get_history()
3571 zc.zc_history_len = *len; in get_history()
3572 zc.zc_history_offset = *off; in get_history()
3574 if (ioctl(hdl->libzfs_fd, ZFS_IOC_POOL_GET_HISTORY, &zc) != 0) { in get_history()
3596 *len = zc.zc_history_len; in get_history()
3597 *off = zc.zc_history_offset; in get_history()
3707 zfs_cmd_t zc = { 0 }; in zpool_obj_to_path() local
3719 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_obj_to_path()
3720 zc.zc_obj = dsobj; in zpool_obj_to_path()
3722 ZFS_IOC_DSOBJ_TO_DSNAME, &zc) != 0) { in zpool_obj_to_path()
3728 (void) strlcpy(dsname, zc.zc_value, sizeof (dsname)); in zpool_obj_to_path()
3734 (void) strlcpy(zc.zc_name, dsname, sizeof (zc.zc_name)); in zpool_obj_to_path()
3735 zc.zc_obj = obj; in zpool_obj_to_path()
3737 &zc) == 0) { in zpool_obj_to_path()
3740 zc.zc_value); in zpool_obj_to_path()
3743 dsname, zc.zc_value); in zpool_obj_to_path()