Lines Matching refs:zc

77 	zfs_cmd_t zc = {"\0"};  in zpool_get_all_props()  local
80 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_get_all_props()
86 zcmd_write_src_nvlist(hdl, &zc, innvl); in zpool_get_all_props()
89 zcmd_alloc_dst_nvlist(hdl, &zc, 0); in zpool_get_all_props()
91 while (zfs_ioctl(hdl, ZFS_IOC_POOL_GET_PROPS, &zc) != 0) { in zpool_get_all_props()
93 zcmd_expand_dst_nvlist(hdl, &zc); in zpool_get_all_props()
95 zcmd_free_nvlists(&zc); in zpool_get_all_props()
100 if (zcmd_read_dst_nvlist(hdl, &zc, &zhp->zpool_props) != 0) { in zpool_get_all_props()
101 zcmd_free_nvlists(&zc); in zpool_get_all_props()
105 zcmd_free_nvlists(&zc); in zpool_get_all_props()
896 zfs_cmd_t zc = {"\0"}; in zpool_set_prop() local
929 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_set_prop()
931 zcmd_write_src_nvlist(zhp->zpool_hdl, &zc, nvl); in zpool_set_prop()
933 ret = zfs_ioctl(zhp->zpool_hdl, ZFS_IOC_POOL_SET_PROPS, &zc); in zpool_set_prop()
935 zcmd_free_nvlists(&zc); in zpool_set_prop()
1510 zfs_cmd_t zc = {"\0"}; in zpool_create() local
1525 zcmd_write_conf_nvlist(hdl, &zc, nvroot); in zpool_create()
1587 zcmd_write_src_nvlist(hdl, &zc, zc_props); in zpool_create()
1589 (void) strlcpy(zc.zc_name, pool, sizeof (zc.zc_name)); in zpool_create()
1591 if ((ret = zfs_ioctl(hdl, ZFS_IOC_POOL_CREATE, &zc)) != 0) { in zpool_create()
1593 zcmd_free_nvlists(&zc); in zpool_create()
1672 zcmd_free_nvlists(&zc); in zpool_create()
1688 zfs_cmd_t zc = {"\0"}; in zpool_destroy() local
1697 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_destroy()
1698 zc.zc_history = (uint64_t)(uintptr_t)log_str; in zpool_destroy()
1700 if (zfs_ioctl(hdl, ZFS_IOC_POOL_DESTROY, &zc) != 0) { in zpool_destroy()
1796 zfs_cmd_t zc = {"\0"}; in zpool_add() local
1824 zcmd_write_conf_nvlist(hdl, &zc, nvroot); in zpool_add()
1825 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_add()
1826 zc.zc_flags = check_ashift; in zpool_add()
1828 if (zfs_ioctl(hdl, ZFS_IOC_VDEV_ADD, &zc) != 0) { in zpool_add()
1894 zcmd_free_nvlists(&zc); in zpool_add()
1907 zfs_cmd_t zc = {"\0"}; in zpool_export_common() local
1909 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_export_common()
1910 zc.zc_cookie = force; in zpool_export_common()
1911 zc.zc_guid = hardforce; in zpool_export_common()
1912 zc.zc_history = (uint64_t)(uintptr_t)log_str; in zpool_export_common()
1914 if (zfs_ioctl(zhp->zpool_hdl, ZFS_IOC_POOL_EXPORT, &zc) != 0) { in zpool_export_common()
2179 zfs_cmd_t zc = {"\0"}; in zpool_import_props() local
2215 zcmd_write_src_nvlist(hdl, &zc, props); in zpool_import_props()
2219 (void) strlcpy(zc.zc_name, thename, sizeof (zc.zc_name)); in zpool_import_props()
2221 zc.zc_guid = fnvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_GUID); in zpool_import_props()
2223 zcmd_write_conf_nvlist(hdl, &zc, config); in zpool_import_props()
2224 zcmd_alloc_dst_nvlist(hdl, &zc, zc.zc_nvlist_conf_size * 2); in zpool_import_props()
2226 zc.zc_cookie = flags; in zpool_import_props()
2227 while ((ret = zfs_ioctl(hdl, ZFS_IOC_POOL_IMPORT, &zc)) != 0 && in zpool_import_props()
2229 zcmd_expand_dst_nvlist(hdl, &zc); in zpool_import_props()
2233 (void) zcmd_read_dst_nvlist(hdl, &zc, &nv); in zpool_import_props()
2235 zcmd_free_nvlists(&zc); in zpool_import_props()
2747 zfs_cmd_t zc = {"\0"}; in zpool_scan() local
2748 (void) strlcpy(zc.zc_name, zhp->zpool_name, in zpool_scan()
2749 sizeof (zc.zc_name)); in zpool_scan()
2750 zc.zc_cookie = func; in zpool_scan()
2751 zc.zc_flags = cmd; in zpool_scan()
2753 if (zfs_ioctl(hdl, ZFS_IOC_POOL_SCAN, &zc) == 0) in zpool_scan()
3246 zfs_cmd_t zc = {"\0"}; in zpool_vdev_online() local
3260 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_vdev_online()
3265 zc.zc_guid = fnvlist_lookup_uint64(tgt, ZPOOL_CONFIG_GUID); in zpool_vdev_online()
3311 zc.zc_cookie = VDEV_STATE_ONLINE; in zpool_vdev_online()
3312 zc.zc_obj = flags; in zpool_vdev_online()
3314 if (zfs_ioctl(hdl, ZFS_IOC_VDEV_SET_STATE, &zc) != 0) { in zpool_vdev_online()
3324 *newstate = zc.zc_cookie; in zpool_vdev_online()
3334 zfs_cmd_t zc = {"\0"}; in zpool_vdev_offline() local
3343 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_vdev_offline()
3348 zc.zc_guid = fnvlist_lookup_uint64(tgt, ZPOOL_CONFIG_GUID); in zpool_vdev_offline()
3353 zc.zc_cookie = VDEV_STATE_OFFLINE; in zpool_vdev_offline()
3354 zc.zc_obj = istmp ? ZFS_OFFLINE_TEMPORARY : 0; in zpool_vdev_offline()
3356 if (zfs_ioctl(hdl, ZFS_IOC_VDEV_SET_STATE, &zc) == 0) in zpool_vdev_offline()
3388 zfs_cmd_t zc = {"\0"}; in zpool_vdev_remove_wanted() local
3397 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_vdev_remove_wanted()
3402 zc.zc_guid = fnvlist_lookup_uint64(tgt, ZPOOL_CONFIG_GUID); in zpool_vdev_remove_wanted()
3404 zc.zc_cookie = VDEV_STATE_REMOVED; in zpool_vdev_remove_wanted()
3406 if (zfs_ioctl(hdl, ZFS_IOC_VDEV_SET_STATE, &zc) == 0) in zpool_vdev_remove_wanted()
3418 zfs_cmd_t zc = {"\0"}; in zpool_vdev_fault() local
3425 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_vdev_fault()
3426 zc.zc_guid = guid; in zpool_vdev_fault()
3427 zc.zc_cookie = VDEV_STATE_FAULTED; in zpool_vdev_fault()
3428 zc.zc_obj = aux; in zpool_vdev_fault()
3430 if (zfs_ioctl(hdl, ZFS_IOC_VDEV_SET_STATE, &zc) == 0) in zpool_vdev_fault()
3454 zfs_cmd_t zc = {"\0"}; in zpool_vdev_set_state() local
3462 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_vdev_set_state()
3463 zc.zc_guid = guid; in zpool_vdev_set_state()
3464 zc.zc_cookie = state; in zpool_vdev_set_state()
3465 zc.zc_obj = aux; in zpool_vdev_set_state()
3467 if (zfs_ioctl(hdl, ZFS_IOC_VDEV_SET_STATE, &zc) == 0) in zpool_vdev_set_state()
3529 zfs_cmd_t zc = {"\0"}; in zpool_vdev_attach() local
3549 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_vdev_attach()
3560 zc.zc_guid = fnvlist_lookup_uint64(tgt, ZPOOL_CONFIG_GUID); in zpool_vdev_attach()
3561 zc.zc_cookie = replacing; in zpool_vdev_attach()
3562 zc.zc_simple = rebuild; in zpool_vdev_attach()
3609 zcmd_write_conf_nvlist(hdl, &zc, nvroot); in zpool_vdev_attach()
3611 ret = zfs_ioctl(hdl, ZFS_IOC_VDEV_ATTACH, &zc); in zpool_vdev_attach()
3613 zcmd_free_nvlists(&zc); in zpool_vdev_attach()
3758 zfs_cmd_t zc = {"\0"}; in zpool_vdev_detach() local
3767 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_vdev_detach()
3778 zc.zc_guid = fnvlist_lookup_uint64(tgt, ZPOOL_CONFIG_GUID); in zpool_vdev_detach()
3780 if (zfs_ioctl(hdl, ZFS_IOC_VDEV_DETACH, &zc) == 0) in zpool_vdev_detach()
3856 zfs_cmd_t zc = {"\0"}; in zpool_vdev_split() local
4051 zc.zc_cookie = ZPOOL_EXPORT_AFTER_SPLIT; in zpool_vdev_split()
4052 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_vdev_split()
4053 (void) strlcpy(zc.zc_string, newname, sizeof (zc.zc_string)); in zpool_vdev_split()
4054 zcmd_write_conf_nvlist(hdl, &zc, newconfig); in zpool_vdev_split()
4056 zcmd_write_src_nvlist(hdl, &zc, zc_props); in zpool_vdev_split()
4058 if (zfs_ioctl(hdl, ZFS_IOC_VDEV_SPLIT, &zc) != 0) { in zpool_vdev_split()
4074 zcmd_free_nvlists(&zc); in zpool_vdev_split()
4097 zfs_cmd_t zc = {"\0"}; in zpool_vdev_remove() local
4113 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_vdev_remove()
4125 zc.zc_guid = fnvlist_lookup_uint64(tgt, ZPOOL_CONFIG_GUID); in zpool_vdev_remove()
4127 if (zfs_ioctl(hdl, ZFS_IOC_VDEV_REMOVE, &zc) == 0) in zpool_vdev_remove()
4175 zfs_cmd_t zc = {{0}}; in zpool_vdev_remove_cancel() local
4182 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_vdev_remove_cancel()
4183 zc.zc_cookie = 1; in zpool_vdev_remove_cancel()
4185 if (zfs_ioctl(hdl, ZFS_IOC_VDEV_REMOVE, &zc) == 0) in zpool_vdev_remove_cancel()
4227 zfs_cmd_t zc = {"\0"}; in zpool_clear() local
4245 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_clear()
4258 zc.zc_guid = fnvlist_lookup_uint64(tgt, ZPOOL_CONFIG_GUID); in zpool_clear()
4262 zc.zc_cookie = policy.zlp_rewind; in zpool_clear()
4264 zcmd_alloc_dst_nvlist(hdl, &zc, zhp->zpool_config_size * 2); in zpool_clear()
4265 zcmd_write_src_nvlist(hdl, &zc, rewindnvl); in zpool_clear()
4267 while ((error = zfs_ioctl(hdl, ZFS_IOC_CLEAR, &zc)) != 0 && in zpool_clear()
4269 zcmd_expand_dst_nvlist(hdl, &zc); in zpool_clear()
4275 (void) zcmd_read_dst_nvlist(hdl, &zc, &nvi); in zpool_clear()
4276 zpool_rewind_exclaim(hdl, zc.zc_name, in zpool_clear()
4281 zcmd_free_nvlists(&zc); in zpool_clear()
4285 zcmd_free_nvlists(&zc); in zpool_clear()
4295 zfs_cmd_t zc = {"\0"}; in zpool_vdev_clear() local
4303 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_vdev_clear()
4304 zc.zc_guid = guid; in zpool_vdev_clear()
4305 zc.zc_cookie = ZPOOL_NO_REWIND; in zpool_vdev_clear()
4307 if (zfs_ioctl(hdl, ZFS_IOC_CLEAR, &zc) == 0) in zpool_vdev_clear()
4327 zfs_cmd_t zc = {"\0"}; in zpool_set_guid() local
4339 zcmd_write_src_nvlist(hdl, &zc, nvl); in zpool_set_guid()
4345 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_set_guid()
4346 error = zfs_ioctl(hdl, ZFS_IOC_POOL_REGUID, &zc); in zpool_set_guid()
4351 zcmd_free_nvlists(&zc); in zpool_set_guid()
4553 zfs_cmd_t zc = {"\0"}; in zpool_get_errlog() local
4566 (void) strcpy(zc.zc_name, zhp->zpool_name); in zpool_get_errlog()
4570 zc.zc_nvlist_dst = (uintptr_t)buf; in zpool_get_errlog()
4571 zc.zc_nvlist_dst_size = buflen; in zpool_get_errlog()
4573 &zc) != 0) { in zpool_get_errlog()
4594 zbookmark_phys_t *zb = buf + zc.zc_nvlist_dst_size; in zpool_get_errlog()
4595 uint64_t zblen = buflen - zc.zc_nvlist_dst_size; in zpool_get_errlog()
4645 zfs_cmd_t zc = {"\0"}; in zpool_upgrade() local
4648 (void) strcpy(zc.zc_name, zhp->zpool_name); in zpool_upgrade()
4649 zc.zc_cookie = new_version; in zpool_upgrade()
4651 if (zfs_ioctl(hdl, ZFS_IOC_POOL_UPGRADE, &zc) != 0) in zpool_upgrade()
4673 zfs_cmd_t zc = {"\0"}; in zpool_log_history() local
4678 zcmd_write_src_nvlist(hdl, &zc, args); in zpool_log_history()
4679 int err = zfs_ioctl(hdl, ZFS_IOC_LOG_HISTORY, &zc); in zpool_log_history()
4681 zcmd_free_nvlists(&zc); in zpool_log_history()
4697 zfs_cmd_t zc = {"\0"}; in get_history() local
4700 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in get_history()
4702 zc.zc_history = (uint64_t)(uintptr_t)buf; in get_history()
4703 zc.zc_history_len = *len; in get_history()
4704 zc.zc_history_offset = *off; in get_history()
4706 if (zfs_ioctl(hdl, ZFS_IOC_POOL_GET_HISTORY, &zc) != 0) { in get_history()
4728 *len = zc.zc_history_len; in get_history()
4729 *off = zc.zc_history_offset; in get_history()
4813 zfs_cmd_t zc = {"\0"}; in zpool_events_next() local
4818 zc.zc_cleanup_fd = zevent_fd; in zpool_events_next()
4821 zc.zc_guid = ZEVENT_NONBLOCK; in zpool_events_next()
4823 zcmd_alloc_dst_nvlist(hdl, &zc, ZEVENT_SIZE); in zpool_events_next()
4826 if (zfs_ioctl(hdl, ZFS_IOC_EVENTS_NEXT, &zc) != 0) { in zpool_events_next()
4840 zcmd_expand_dst_nvlist(hdl, &zc); in zpool_events_next()
4849 error = zcmd_read_dst_nvlist(hdl, &zc, nvp); in zpool_events_next()
4853 *dropped = (int)zc.zc_cookie; in zpool_events_next()
4855 zcmd_free_nvlists(&zc); in zpool_events_next()
4866 zfs_cmd_t zc = {"\0"}; in zpool_events_clear() local
4868 if (zfs_ioctl(hdl, ZFS_IOC_EVENTS_CLEAR, &zc) != 0) in zpool_events_clear()
4873 *count = (int)zc.zc_cookie; /* # of events cleared */ in zpool_events_clear()
4886 zfs_cmd_t zc = {"\0"}; in zpool_events_seek() local
4889 zc.zc_guid = eid; in zpool_events_seek()
4890 zc.zc_cleanup_fd = zevent_fd; in zpool_events_seek()
4892 if (zfs_ioctl(hdl, ZFS_IOC_EVENTS_SEEK, &zc) != 0) { in zpool_events_seek()
4918 zfs_cmd_t zc = {"\0"}; in zpool_obj_to_path_impl() local
4931 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_obj_to_path_impl()
4932 zc.zc_obj = dsobj; in zpool_obj_to_path_impl()
4934 ZFS_IOC_DSOBJ_TO_DSNAME, &zc) != 0) { in zpool_obj_to_path_impl()
4940 (void) strlcpy(dsname, zc.zc_value, sizeof (dsname)); in zpool_obj_to_path_impl()
4947 (void) strlcpy(zc.zc_name, dsname, sizeof (zc.zc_name)); in zpool_obj_to_path_impl()
4948 zc.zc_obj = obj; in zpool_obj_to_path_impl()
4950 &zc) == 0) { in zpool_obj_to_path_impl()
4953 zc.zc_value); in zpool_obj_to_path_impl()
4956 dsname, zc.zc_value); in zpool_obj_to_path_impl()