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()
1063 zfs_cmd_t zc = { 0 }; in zpool_create() local
1075 if (zcmd_write_conf_nvlist(hdl, &zc, nvroot) != 0) in zpool_create()
1109 if (zc_props && zcmd_write_src_nvlist(hdl, &zc, zc_props) != 0) in zpool_create()
1112 (void) strlcpy(zc.zc_name, pool, sizeof (zc.zc_name)); in zpool_create()
1114 if ((ret = zfs_ioctl(hdl, ZFS_IOC_POOL_CREATE, &zc)) != 0) { in zpool_create()
1116 zcmd_free_nvlists(&zc); in zpool_create()
1166 zcmd_free_nvlists(&zc); in zpool_create()
1179 zfs_cmd_t zc = { 0 }; in zpool_destroy() local
1188 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_destroy()
1189 zc.zc_history = (uint64_t)(uintptr_t)log_str; in zpool_destroy()
1191 if (zfs_ioctl(hdl, ZFS_IOC_POOL_DESTROY, &zc) != 0) { in zpool_destroy()
1223 zfs_cmd_t zc = { 0 }; in zpool_add() local
1251 if (zcmd_write_conf_nvlist(hdl, &zc, nvroot) != 0) in zpool_add()
1253 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_add()
1255 if (zfs_ioctl(hdl, ZFS_IOC_VDEV_ADD, &zc) != 0) { in zpool_add()
1316 zcmd_free_nvlists(&zc); in zpool_add()
1329 zfs_cmd_t zc = { 0 }; in zpool_export_common() local
1335 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_export_common()
1336 zc.zc_cookie = force; in zpool_export_common()
1337 zc.zc_guid = hardforce; in zpool_export_common()
1338 zc.zc_history = (uint64_t)(uintptr_t)log_str; in zpool_export_common()
1340 if (zfs_ioctl(zhp->zpool_hdl, ZFS_IOC_POOL_EXPORT, &zc) != 0) { in zpool_export_common()
1599 zfs_cmd_t zc = { 0 }; in zpool_import_props() local
1636 if (zcmd_write_src_nvlist(hdl, &zc, props) != 0) { in zpool_import_props()
1643 (void) strlcpy(zc.zc_name, thename, sizeof (zc.zc_name)); in zpool_import_props()
1646 &zc.zc_guid) == 0); in zpool_import_props()
1648 if (zcmd_write_conf_nvlist(hdl, &zc, config) != 0) { in zpool_import_props()
1649 zcmd_free_nvlists(&zc); in zpool_import_props()
1652 if (zcmd_alloc_dst_nvlist(hdl, &zc, zc.zc_nvlist_conf_size * 2) != 0) { in zpool_import_props()
1653 zcmd_free_nvlists(&zc); in zpool_import_props()
1657 zc.zc_cookie = flags; in zpool_import_props()
1658 while ((ret = zfs_ioctl(hdl, ZFS_IOC_POOL_IMPORT, &zc)) != 0 && in zpool_import_props()
1660 if (zcmd_expand_dst_nvlist(hdl, &zc) != 0) { in zpool_import_props()
1661 zcmd_free_nvlists(&zc); in zpool_import_props()
1668 (void) zcmd_read_dst_nvlist(hdl, &zc, &nv); in zpool_import_props()
1670 zcmd_free_nvlists(&zc); in zpool_import_props()
1786 zfs_cmd_t zc = { 0 }; in zpool_scan() local
1790 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_scan()
1791 zc.zc_cookie = func; in zpool_scan()
1793 if (zfs_ioctl(hdl, ZFS_IOC_POOL_SCAN, &zc) == 0 || in zpool_scan()
1799 dgettext(TEXT_DOMAIN, "cannot scrub %s"), zc.zc_name); in zpool_scan()
1803 zc.zc_name); in zpool_scan()
2328 zfs_cmd_t zc = { 0 }; in zpool_vdev_online() local
2342 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_vdev_online()
2347 verify(nvlist_lookup_uint64(tgt, ZPOOL_CONFIG_GUID, &zc.zc_guid) == 0); in zpool_vdev_online()
2377 zc.zc_cookie = VDEV_STATE_ONLINE; in zpool_vdev_online()
2378 zc.zc_obj = flags; in zpool_vdev_online()
2380 if (zfs_ioctl(hdl, ZFS_IOC_VDEV_SET_STATE, &zc) != 0) { in zpool_vdev_online()
2390 *newstate = zc.zc_cookie; in zpool_vdev_online()
2400 zfs_cmd_t zc = { 0 }; in zpool_vdev_offline() local
2409 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_vdev_offline()
2414 verify(nvlist_lookup_uint64(tgt, ZPOOL_CONFIG_GUID, &zc.zc_guid) == 0); in zpool_vdev_offline()
2419 zc.zc_cookie = VDEV_STATE_OFFLINE; in zpool_vdev_offline()
2420 zc.zc_obj = istmp ? ZFS_OFFLINE_TEMPORARY : 0; in zpool_vdev_offline()
2422 if (zfs_ioctl(hdl, ZFS_IOC_VDEV_SET_STATE, &zc) == 0) in zpool_vdev_offline()
2450 zfs_cmd_t zc = { 0 }; in zpool_vdev_fault() local
2457 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_vdev_fault()
2458 zc.zc_guid = guid; in zpool_vdev_fault()
2459 zc.zc_cookie = VDEV_STATE_FAULTED; in zpool_vdev_fault()
2460 zc.zc_obj = aux; in zpool_vdev_fault()
2462 if (ioctl(hdl->libzfs_fd, ZFS_IOC_VDEV_SET_STATE, &zc) == 0) in zpool_vdev_fault()
2485 zfs_cmd_t zc = { 0 }; in zpool_vdev_degrade() local
2492 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_vdev_degrade()
2493 zc.zc_guid = guid; in zpool_vdev_degrade()
2494 zc.zc_cookie = VDEV_STATE_DEGRADED; in zpool_vdev_degrade()
2495 zc.zc_obj = aux; in zpool_vdev_degrade()
2497 if (ioctl(hdl->libzfs_fd, ZFS_IOC_VDEV_SET_STATE, &zc) == 0) in zpool_vdev_degrade()
2539 zfs_cmd_t zc = { 0 }; in zpool_vdev_attach() local
2559 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_vdev_attach()
2570 verify(nvlist_lookup_uint64(tgt, ZPOOL_CONFIG_GUID, &zc.zc_guid) == 0); in zpool_vdev_attach()
2571 zc.zc_cookie = replacing; in zpool_vdev_attach()
2603 if (zcmd_write_conf_nvlist(hdl, &zc, nvroot) != 0) in zpool_vdev_attach()
2606 ret = zfs_ioctl(hdl, ZFS_IOC_VDEV_ATTACH, &zc); in zpool_vdev_attach()
2608 zcmd_free_nvlists(&zc); in zpool_vdev_attach()
2703 zfs_cmd_t zc = { 0 }; in zpool_vdev_detach() local
2712 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_vdev_detach()
2723 verify(nvlist_lookup_uint64(tgt, ZPOOL_CONFIG_GUID, &zc.zc_guid) == 0); in zpool_vdev_detach()
2725 if (zfs_ioctl(hdl, ZFS_IOC_VDEV_DETACH, &zc) == 0) in zpool_vdev_detach()
2801 zfs_cmd_t zc = { 0 }; in zpool_vdev_split() local
2961 zc.zc_cookie = ZPOOL_EXPORT_AFTER_SPLIT; in zpool_vdev_split()
2962 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_vdev_split()
2963 (void) strlcpy(zc.zc_string, newname, sizeof (zc.zc_string)); in zpool_vdev_split()
2964 if (zcmd_write_conf_nvlist(hdl, &zc, newconfig) != 0) in zpool_vdev_split()
2966 if (zc_props != NULL && zcmd_write_src_nvlist(hdl, &zc, zc_props) != 0) in zpool_vdev_split()
2969 if (zfs_ioctl(hdl, ZFS_IOC_VDEV_SPLIT, &zc) != 0) { in zpool_vdev_split()
2985 zcmd_free_nvlists(&zc); in zpool_vdev_split()
3009 zfs_cmd_t zc = { 0 }; in zpool_vdev_remove() local
3019 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_vdev_remove()
3040 verify(nvlist_lookup_uint64(tgt, ZPOOL_CONFIG_GUID, &zc.zc_guid) == 0); in zpool_vdev_remove()
3042 if (zfs_ioctl(hdl, ZFS_IOC_VDEV_REMOVE, &zc) == 0) in zpool_vdev_remove()
3054 zfs_cmd_t zc = { 0 }; in zpool_clear() local
3072 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_clear()
3086 &zc.zc_guid) == 0); in zpool_clear()
3090 zc.zc_cookie = policy.zrp_request; in zpool_clear()
3092 if (zcmd_alloc_dst_nvlist(hdl, &zc, zhp->zpool_config_size * 2) != 0) in zpool_clear()
3095 if (zcmd_write_src_nvlist(hdl, &zc, rewindnvl) != 0) in zpool_clear()
3098 while ((error = zfs_ioctl(hdl, ZFS_IOC_CLEAR, &zc)) != 0 && in zpool_clear()
3100 if (zcmd_expand_dst_nvlist(hdl, &zc) != 0) { in zpool_clear()
3101 zcmd_free_nvlists(&zc); in zpool_clear()
3110 (void) zcmd_read_dst_nvlist(hdl, &zc, &nvi); in zpool_clear()
3111 zpool_rewind_exclaim(hdl, zc.zc_name, in zpool_clear()
3116 zcmd_free_nvlists(&zc); in zpool_clear()
3120 zcmd_free_nvlists(&zc); in zpool_clear()
3130 zfs_cmd_t zc = { 0 }; in zpool_vdev_clear() local
3138 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_vdev_clear()
3139 zc.zc_guid = guid; in zpool_vdev_clear()
3140 zc.zc_cookie = ZPOOL_NO_REWIND; in zpool_vdev_clear()
3142 if (ioctl(hdl->libzfs_fd, ZFS_IOC_CLEAR, &zc) == 0) in zpool_vdev_clear()
3156 zfs_cmd_t zc = { 0 }; in zpool_reguid() local
3161 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_reguid()
3162 if (zfs_ioctl(hdl, ZFS_IOC_POOL_REGUID, &zc) == 0) in zpool_reguid()
3174 zfs_cmd_t zc = { 0 }; in zpool_reopen() local
3182 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_reopen()
3183 if (zfs_ioctl(hdl, ZFS_IOC_POOL_REOPEN, &zc) == 0) in zpool_reopen()
3256 zfs_cmd_t zc = { 0 }; in set_path() local
3258 (void) strncpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in set_path()
3259 (void) strncpy(zc.zc_value, path, sizeof (zc.zc_value)); in set_path()
3261 &zc.zc_guid) == 0); in set_path()
3263 (void) ioctl(zhp->zpool_hdl->libzfs_fd, ZFS_IOC_VDEV_SETPATH, &zc); in set_path()
3407 zfs_cmd_t zc = { 0 }; in zpool_get_errlog() local
3421 if ((zc.zc_nvlist_dst = (uintptr_t)zfs_alloc(zhp->zpool_hdl, in zpool_get_errlog()
3424 zc.zc_nvlist_dst_size = count; in zpool_get_errlog()
3425 (void) strcpy(zc.zc_name, zhp->zpool_name); in zpool_get_errlog()
3428 &zc) != 0) { in zpool_get_errlog()
3429 free((void *)(uintptr_t)zc.zc_nvlist_dst); in zpool_get_errlog()
3433 count = zc.zc_nvlist_dst_size; in zpool_get_errlog()
3438 zc.zc_nvlist_dst = (uintptr_t)dst; in zpool_get_errlog()
3454 zb = ((zbookmark_phys_t *)(uintptr_t)zc.zc_nvlist_dst) + in zpool_get_errlog()
3455 zc.zc_nvlist_dst_size; in zpool_get_errlog()
3456 count -= zc.zc_nvlist_dst_size; in zpool_get_errlog()
3492 free((void *)(uintptr_t)zc.zc_nvlist_dst); in zpool_get_errlog()
3496 free((void *)(uintptr_t)zc.zc_nvlist_dst); in zpool_get_errlog()
3506 zfs_cmd_t zc = { 0 }; in zpool_upgrade() local
3509 (void) strcpy(zc.zc_name, zhp->zpool_name); in zpool_upgrade()
3510 zc.zc_cookie = new_version; in zpool_upgrade()
3512 if (zfs_ioctl(hdl, ZFS_IOC_POOL_UPGRADE, &zc) != 0) in zpool_upgrade()
3532 zfs_cmd_t zc = { 0 }; in zpool_log_history() local
3538 err = zcmd_write_src_nvlist(hdl, &zc, args); in zpool_log_history()
3540 err = ioctl(hdl->libzfs_fd, ZFS_IOC_LOG_HISTORY, &zc); in zpool_log_history()
3542 zcmd_free_nvlists(&zc); in zpool_log_history()
3558 zfs_cmd_t zc = { 0 }; in get_history() local
3561 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in get_history()
3563 zc.zc_history = (uint64_t)(uintptr_t)buf; in get_history()
3564 zc.zc_history_len = *len; in get_history()
3565 zc.zc_history_offset = *off; in get_history()
3567 if (ioctl(hdl->libzfs_fd, ZFS_IOC_POOL_GET_HISTORY, &zc) != 0) { in get_history()
3589 *len = zc.zc_history_len; in get_history()
3590 *off = zc.zc_history_offset; in get_history()
3700 zfs_cmd_t zc = { 0 }; in zpool_obj_to_path() local
3712 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_obj_to_path()
3713 zc.zc_obj = dsobj; in zpool_obj_to_path()
3715 ZFS_IOC_DSOBJ_TO_DSNAME, &zc) != 0) { in zpool_obj_to_path()
3721 (void) strlcpy(dsname, zc.zc_value, sizeof (dsname)); in zpool_obj_to_path()
3727 (void) strlcpy(zc.zc_name, dsname, sizeof (zc.zc_name)); in zpool_obj_to_path()
3728 zc.zc_obj = obj; in zpool_obj_to_path()
3730 &zc) == 0) { in zpool_obj_to_path()
3733 zc.zc_value); in zpool_obj_to_path()
3736 dsname, zc.zc_value); in zpool_obj_to_path()