Lines Matching refs:zc

78 	zfs_cmd_t zc = { 0 };  in zpool_get_all_props()  local
81 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_get_all_props()
83 if (zcmd_alloc_dst_nvlist(hdl, &zc, 0) != 0) in zpool_get_all_props()
86 while (ioctl(hdl->libzfs_fd, ZFS_IOC_POOL_GET_PROPS, &zc) != 0) { in zpool_get_all_props()
88 if (zcmd_expand_dst_nvlist(hdl, &zc) != 0) { in zpool_get_all_props()
89 zcmd_free_nvlists(&zc); in zpool_get_all_props()
93 zcmd_free_nvlists(&zc); in zpool_get_all_props()
98 if (zcmd_read_dst_nvlist(hdl, &zc, &zhp->zpool_props) != 0) { in zpool_get_all_props()
99 zcmd_free_nvlists(&zc); in zpool_get_all_props()
103 zcmd_free_nvlists(&zc); in zpool_get_all_props()
727 zfs_cmd_t zc = { 0 }; in zpool_set_prop() local
760 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_set_prop()
762 if (zcmd_write_src_nvlist(zhp->zpool_hdl, &zc, nvl) != 0) { in zpool_set_prop()
767 ret = zfs_ioctl(zhp->zpool_hdl, ZFS_IOC_POOL_SET_PROPS, &zc); in zpool_set_prop()
769 zcmd_free_nvlists(&zc); in zpool_set_prop()
1192 zfs_cmd_t zc = { 0 }; in zpool_create() local
1207 if (zcmd_write_conf_nvlist(hdl, &zc, nvroot) != 0) in zpool_create()
1269 if (zc_props && zcmd_write_src_nvlist(hdl, &zc, zc_props) != 0) in zpool_create()
1272 (void) strlcpy(zc.zc_name, pool, sizeof (zc.zc_name)); in zpool_create()
1274 if ((ret = zfs_ioctl(hdl, ZFS_IOC_POOL_CREATE, &zc)) != 0) { in zpool_create()
1276 zcmd_free_nvlists(&zc); in zpool_create()
1340 zcmd_free_nvlists(&zc); in zpool_create()
1356 zfs_cmd_t zc = { 0 }; in zpool_destroy() local
1365 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_destroy()
1366 zc.zc_history = (uint64_t)(uintptr_t)log_str; in zpool_destroy()
1368 if (zfs_ioctl(hdl, ZFS_IOC_POOL_DESTROY, &zc) != 0) { in zpool_destroy()
1442 zfs_cmd_t zc = { 0 }; in zpool_add() local
1470 if (zcmd_write_conf_nvlist(hdl, &zc, nvroot) != 0) in zpool_add()
1472 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_add()
1474 if (zfs_ioctl(hdl, ZFS_IOC_VDEV_ADD, &zc) != 0) { in zpool_add()
1530 zcmd_free_nvlists(&zc); in zpool_add()
1543 zfs_cmd_t zc = { 0 }; in zpool_export_common() local
1549 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_export_common()
1550 zc.zc_cookie = force; in zpool_export_common()
1551 zc.zc_guid = hardforce; in zpool_export_common()
1552 zc.zc_history = (uint64_t)(uintptr_t)log_str; in zpool_export_common()
1554 if (zfs_ioctl(zhp->zpool_hdl, ZFS_IOC_POOL_EXPORT, &zc) != 0) { in zpool_export_common()
1813 zfs_cmd_t zc = { 0 }; in zpool_import_props() local
1850 if (zcmd_write_src_nvlist(hdl, &zc, props) != 0) { in zpool_import_props()
1857 (void) strlcpy(zc.zc_name, thename, sizeof (zc.zc_name)); in zpool_import_props()
1860 &zc.zc_guid) == 0); in zpool_import_props()
1862 if (zcmd_write_conf_nvlist(hdl, &zc, config) != 0) { in zpool_import_props()
1863 zcmd_free_nvlists(&zc); in zpool_import_props()
1866 if (zcmd_alloc_dst_nvlist(hdl, &zc, zc.zc_nvlist_conf_size * 2) != 0) { in zpool_import_props()
1867 zcmd_free_nvlists(&zc); in zpool_import_props()
1871 zc.zc_cookie = flags; in zpool_import_props()
1872 while ((ret = zfs_ioctl(hdl, ZFS_IOC_POOL_IMPORT, &zc)) != 0 && in zpool_import_props()
1874 if (zcmd_expand_dst_nvlist(hdl, &zc) != 0) { in zpool_import_props()
1875 zcmd_free_nvlists(&zc); in zpool_import_props()
1882 (void) zcmd_read_dst_nvlist(hdl, &zc, &nv); in zpool_import_props()
1884 zcmd_free_nvlists(&zc); in zpool_import_props()
2098 zfs_cmd_t zc = { 0 }; in zpool_scan() local
2103 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_scan()
2104 zc.zc_cookie = func; in zpool_scan()
2105 zc.zc_flags = cmd; in zpool_scan()
2107 if (zfs_ioctl(hdl, ZFS_IOC_POOL_SCAN, &zc) == 0) in zpool_scan()
2123 "cannot pause scrubbing %s"), zc.zc_name); in zpool_scan()
2127 "cannot scrub %s"), zc.zc_name); in zpool_scan()
2132 "cannot restart resilver on %s"), zc.zc_name); in zpool_scan()
2136 zc.zc_name); in zpool_scan()
2870 zfs_cmd_t zc = { 0 }; in zpool_vdev_online() local
2886 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_vdev_online()
2891 verify(nvlist_lookup_uint64(tgt, ZPOOL_CONFIG_GUID, &zc.zc_guid) == 0); in zpool_vdev_online()
2921 zc.zc_cookie = VDEV_STATE_ONLINE; in zpool_vdev_online()
2922 zc.zc_obj = flags; in zpool_vdev_online()
2924 if (zfs_ioctl(hdl, ZFS_IOC_VDEV_SET_STATE, &zc) != 0) { in zpool_vdev_online()
2934 *newstate = zc.zc_cookie; in zpool_vdev_online()
2944 zfs_cmd_t zc = { 0 }; in zpool_vdev_offline() local
2953 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_vdev_offline()
2958 verify(nvlist_lookup_uint64(tgt, ZPOOL_CONFIG_GUID, &zc.zc_guid) == 0); in zpool_vdev_offline()
2963 zc.zc_cookie = VDEV_STATE_OFFLINE; in zpool_vdev_offline()
2964 zc.zc_obj = istmp ? ZFS_OFFLINE_TEMPORARY : 0; in zpool_vdev_offline()
2966 if (zfs_ioctl(hdl, ZFS_IOC_VDEV_SET_STATE, &zc) == 0) in zpool_vdev_offline()
2994 zfs_cmd_t zc = { 0 }; in zpool_vdev_fault() local
3001 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_vdev_fault()
3002 zc.zc_guid = guid; in zpool_vdev_fault()
3003 zc.zc_cookie = VDEV_STATE_FAULTED; in zpool_vdev_fault()
3004 zc.zc_obj = aux; in zpool_vdev_fault()
3006 if (ioctl(hdl->libzfs_fd, ZFS_IOC_VDEV_SET_STATE, &zc) == 0) in zpool_vdev_fault()
3029 zfs_cmd_t zc = { 0 }; in zpool_vdev_degrade() local
3036 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_vdev_degrade()
3037 zc.zc_guid = guid; in zpool_vdev_degrade()
3038 zc.zc_cookie = VDEV_STATE_DEGRADED; in zpool_vdev_degrade()
3039 zc.zc_obj = aux; in zpool_vdev_degrade()
3041 if (ioctl(hdl->libzfs_fd, ZFS_IOC_VDEV_SET_STATE, &zc) == 0) in zpool_vdev_degrade()
3083 zfs_cmd_t zc = { 0 }; in zpool_vdev_attach() local
3103 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_vdev_attach()
3114 verify(nvlist_lookup_uint64(tgt, ZPOOL_CONFIG_GUID, &zc.zc_guid) == 0); in zpool_vdev_attach()
3115 zc.zc_cookie = replacing; in zpool_vdev_attach()
3152 if (zcmd_write_conf_nvlist(hdl, &zc, nvroot) != 0) in zpool_vdev_attach()
3155 ret = zfs_ioctl(hdl, ZFS_IOC_VDEV_ATTACH, &zc); in zpool_vdev_attach()
3157 zcmd_free_nvlists(&zc); in zpool_vdev_attach()
3254 zfs_cmd_t zc = { 0 }; in zpool_vdev_detach() local
3263 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_vdev_detach()
3274 verify(nvlist_lookup_uint64(tgt, ZPOOL_CONFIG_GUID, &zc.zc_guid) == 0); in zpool_vdev_detach()
3276 if (zfs_ioctl(hdl, ZFS_IOC_VDEV_DETACH, &zc) == 0) in zpool_vdev_detach()
3352 zfs_cmd_t zc = { 0 }; in zpool_vdev_split() local
3512 zc.zc_cookie = ZPOOL_EXPORT_AFTER_SPLIT; in zpool_vdev_split()
3513 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_vdev_split()
3514 (void) strlcpy(zc.zc_string, newname, sizeof (zc.zc_string)); in zpool_vdev_split()
3515 if (zcmd_write_conf_nvlist(hdl, &zc, newconfig) != 0) in zpool_vdev_split()
3517 if (zc_props != NULL && zcmd_write_src_nvlist(hdl, &zc, zc_props) != 0) in zpool_vdev_split()
3520 if (zfs_ioctl(hdl, ZFS_IOC_VDEV_SPLIT, &zc) != 0) { in zpool_vdev_split()
3536 zcmd_free_nvlists(&zc); in zpool_vdev_split()
3559 zfs_cmd_t zc = { 0 }; in zpool_vdev_remove() local
3569 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_vdev_remove()
3581 zc.zc_guid = fnvlist_lookup_uint64(tgt, ZPOOL_CONFIG_GUID); in zpool_vdev_remove()
3583 if (zfs_ioctl(hdl, ZFS_IOC_VDEV_REMOVE, &zc) == 0) in zpool_vdev_remove()
3610 zfs_cmd_t zc = { 0 }; in zpool_vdev_remove_cancel() local
3617 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_vdev_remove_cancel()
3618 zc.zc_cookie = 1; in zpool_vdev_remove_cancel()
3620 if (zfs_ioctl(hdl, ZFS_IOC_VDEV_REMOVE, &zc) == 0) in zpool_vdev_remove_cancel()
3662 zfs_cmd_t zc = { 0 }; in zpool_clear() local
3680 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_clear()
3694 &zc.zc_guid) == 0); in zpool_clear()
3698 zc.zc_cookie = policy.zlp_rewind; in zpool_clear()
3700 if (zcmd_alloc_dst_nvlist(hdl, &zc, zhp->zpool_config_size * 2) != 0) in zpool_clear()
3703 if (zcmd_write_src_nvlist(hdl, &zc, rewindnvl) != 0) in zpool_clear()
3706 while ((error = zfs_ioctl(hdl, ZFS_IOC_CLEAR, &zc)) != 0 && in zpool_clear()
3708 if (zcmd_expand_dst_nvlist(hdl, &zc) != 0) { in zpool_clear()
3709 zcmd_free_nvlists(&zc); in zpool_clear()
3718 (void) zcmd_read_dst_nvlist(hdl, &zc, &nvi); in zpool_clear()
3719 zpool_rewind_exclaim(hdl, zc.zc_name, in zpool_clear()
3724 zcmd_free_nvlists(&zc); in zpool_clear()
3728 zcmd_free_nvlists(&zc); in zpool_clear()
3738 zfs_cmd_t zc = { 0 }; in zpool_vdev_clear() local
3746 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_vdev_clear()
3747 zc.zc_guid = guid; in zpool_vdev_clear()
3748 zc.zc_cookie = ZPOOL_NO_REWIND; in zpool_vdev_clear()
3750 if (ioctl(hdl->libzfs_fd, ZFS_IOC_CLEAR, &zc) == 0) in zpool_vdev_clear()
3764 zfs_cmd_t zc = { 0 }; in zpool_reguid() local
3769 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_reguid()
3770 if (zfs_ioctl(hdl, ZFS_IOC_POOL_REGUID, &zc) == 0) in zpool_reguid()
3782 zfs_cmd_t zc = { 0 }; in zpool_reopen() local
3790 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_reopen()
3791 if (zfs_ioctl(hdl, ZFS_IOC_POOL_REOPEN, &zc) == 0) in zpool_reopen()
3955 zfs_cmd_t zc = { 0 }; in set_path() local
3957 (void) strncpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in set_path()
3958 (void) strncpy(zc.zc_value, path, sizeof (zc.zc_value)); in set_path()
3960 &zc.zc_guid) == 0); in set_path()
3962 (void) ioctl(zhp->zpool_hdl->libzfs_fd, ZFS_IOC_VDEV_SETPATH, &zc); in set_path()
4182 zfs_cmd_t zc = { 0 }; in zpool_get_errlog() local
4196 if ((zc.zc_nvlist_dst = (uintptr_t)zfs_alloc(zhp->zpool_hdl, in zpool_get_errlog()
4199 zc.zc_nvlist_dst_size = count; in zpool_get_errlog()
4200 (void) strcpy(zc.zc_name, zhp->zpool_name); in zpool_get_errlog()
4203 &zc) != 0) { in zpool_get_errlog()
4204 free((void *)(uintptr_t)zc.zc_nvlist_dst); in zpool_get_errlog()
4208 count = zc.zc_nvlist_dst_size; in zpool_get_errlog()
4213 zc.zc_nvlist_dst = (uintptr_t)dst; in zpool_get_errlog()
4229 zb = ((zbookmark_phys_t *)(uintptr_t)zc.zc_nvlist_dst) + in zpool_get_errlog()
4230 zc.zc_nvlist_dst_size; in zpool_get_errlog()
4231 count -= zc.zc_nvlist_dst_size; in zpool_get_errlog()
4267 free((void *)(uintptr_t)zc.zc_nvlist_dst); in zpool_get_errlog()
4271 free((void *)(uintptr_t)zc.zc_nvlist_dst); in zpool_get_errlog()
4281 zfs_cmd_t zc = { 0 }; in zpool_upgrade() local
4284 (void) strcpy(zc.zc_name, zhp->zpool_name); in zpool_upgrade()
4285 zc.zc_cookie = new_version; in zpool_upgrade()
4287 if (zfs_ioctl(hdl, ZFS_IOC_POOL_UPGRADE, &zc) != 0) in zpool_upgrade()
4307 zfs_cmd_t zc = { 0 }; in zpool_log_history() local
4313 err = zcmd_write_src_nvlist(hdl, &zc, args); in zpool_log_history()
4315 err = ioctl(hdl->libzfs_fd, ZFS_IOC_LOG_HISTORY, &zc); in zpool_log_history()
4317 zcmd_free_nvlists(&zc); in zpool_log_history()
4333 zfs_cmd_t zc = { 0 }; in get_history() local
4336 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in get_history()
4338 zc.zc_history = (uint64_t)(uintptr_t)buf; in get_history()
4339 zc.zc_history_len = *len; in get_history()
4340 zc.zc_history_offset = *off; in get_history()
4342 if (ioctl(hdl->libzfs_fd, ZFS_IOC_POOL_GET_HISTORY, &zc) != 0) { in get_history()
4364 *len = zc.zc_history_len; in get_history()
4365 *off = zc.zc_history_offset; in get_history()
4436 zfs_cmd_t zc = { 0 }; in zpool_obj_to_path() local
4448 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_obj_to_path()
4449 zc.zc_obj = dsobj; in zpool_obj_to_path()
4451 ZFS_IOC_DSOBJ_TO_DSNAME, &zc) != 0) { in zpool_obj_to_path()
4457 (void) strlcpy(dsname, zc.zc_value, sizeof (dsname)); in zpool_obj_to_path()
4463 (void) strlcpy(zc.zc_name, dsname, sizeof (zc.zc_name)); in zpool_obj_to_path()
4464 zc.zc_obj = obj; in zpool_obj_to_path()
4466 &zc) == 0) { in zpool_obj_to_path()
4469 zc.zc_value); in zpool_obj_to_path()
4472 dsname, zc.zc_value); in zpool_obj_to_path()