| 1 | /* | 
| 2 |  * CDDL HEADER START | 
| 3 |  * | 
| 4 |  * The contents of this file are subject to the terms of the | 
| 5 |  * Common Development and Distribution License (the "License"). | 
| 6 |  * You may not use this file except in compliance with the License. | 
| 7 |  * | 
| 8 |  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE | 
| 9 |  * or http://www.opensolaris.org/os/licensing. | 
| 10 |  * See the License for the specific language governing permissions | 
| 11 |  * and limitations under the License. | 
| 12 |  * | 
| 13 |  * When distributing Covered Code, include this CDDL HEADER in each | 
| 14 |  * file and include the License file at usr/src/OPENSOLARIS.LICENSE. | 
| 15 |  * If applicable, add the following below this CDDL HEADER, with the | 
| 16 |  * fields enclosed by brackets "[]" replaced with your own identifying | 
| 17 |  * information: Portions Copyright [yyyy] [name of copyright owner] | 
| 18 |  * | 
| 19 |  * CDDL HEADER END | 
| 20 |  */ | 
| 21 | /* | 
| 22 |  * Copyright 2014 Xin Li <delphij@FreeBSD.org>.  All rights reserved. | 
| 23 |  * Copyright 2013 Martin Matuska <mm@FreeBSD.org>.  All rights reserved. | 
| 24 |  * Use is subject to license terms. | 
| 25 |  */ | 
| 26 |  | 
| 27 | #ifndef	_SYS_ZFS_IOCTL_COMPAT_H | 
| 28 | #define	_SYS_ZFS_IOCTL_COMPAT_H | 
| 29 |  | 
| 30 | #include <sys/cred.h> | 
| 31 | #include <sys/sunddi.h> | 
| 32 | #include <sys/dmu.h> | 
| 33 | #include <sys/zio.h> | 
| 34 | #include <sys/dsl_deleg.h> | 
| 35 | #include <sys/zfs_ioctl.h> | 
| 36 |  | 
| 37 | #ifdef _KERNEL | 
| 38 | #include <sys/nvpair.h> | 
| 39 | #endif  /* _KERNEL */ | 
| 40 |  | 
| 41 | #ifdef	__cplusplus | 
| 42 | extern "C"  { | 
| 43 | #endif | 
| 44 |  | 
| 45 | /* | 
| 46 |  * Backwards ioctl compatibility | 
| 47 |  */ | 
| 48 |  | 
| 49 | /* ioctl versions for vfs.zfs.version.ioctl */ | 
| 50 | #define	ZFS_IOCVER_UNDEF	-1 | 
| 51 | #define	ZFS_IOCVER_NONE		0 | 
| 52 | #define	ZFS_IOCVER_DEADMAN	1 | 
| 53 | #define	ZFS_IOCVER_LZC		2 | 
| 54 | #define	ZFS_IOCVER_ZCMD		3 | 
| 55 | #define	ZFS_IOCVER_EDBP		4 | 
| 56 | #define	ZFS_IOCVER_RESUME	5 | 
| 57 | #define	ZFS_IOCVER_INLANES	6 | 
| 58 | #define	ZFS_IOCVER_PAD		7 | 
| 59 | #define	ZFS_IOCVER_CURRENT	ZFS_IOCVER_PAD | 
| 60 |  | 
| 61 | /* compatibility conversion flag */ | 
| 62 | #define	ZFS_CMD_COMPAT_NONE	0 | 
| 63 | #define	ZFS_CMD_COMPAT_V15	1 | 
| 64 | #define	ZFS_CMD_COMPAT_V28	2 | 
| 65 | #define	ZFS_CMD_COMPAT_DEADMAN	3 | 
| 66 | #define	ZFS_CMD_COMPAT_LZC	4 | 
| 67 | #define	ZFS_CMD_COMPAT_ZCMD	5 | 
| 68 | #define	ZFS_CMD_COMPAT_EDBP	6 | 
| 69 | #define	ZFS_CMD_COMPAT_RESUME	7 | 
| 70 | #define	ZFS_CMD_COMPAT_INLANES	8 | 
| 71 |  | 
| 72 | #define	ZFS_IOC_COMPAT_PASS	254 | 
| 73 | #define	ZFS_IOC_COMPAT_FAIL	255 | 
| 74 |  | 
| 75 | #define	ZFS_IOCREQ(ioreq)	((ioreq) & 0xff) | 
| 76 |  | 
| 77 | typedef struct zfs_iocparm { | 
| 78 | 	uint32_t	zfs_ioctl_version; | 
| 79 | 	uint64_t	zfs_cmd; | 
| 80 | 	uint64_t	zfs_cmd_size; | 
| 81 | } zfs_iocparm_t; | 
| 82 |  | 
| 83 | typedef struct zinject_record_v15 { | 
| 84 | 	uint64_t	zi_objset; | 
| 85 | 	uint64_t	zi_object; | 
| 86 | 	uint64_t	zi_start; | 
| 87 | 	uint64_t	zi_end; | 
| 88 | 	uint64_t	zi_guid; | 
| 89 | 	uint32_t	zi_level; | 
| 90 | 	uint32_t	zi_error; | 
| 91 | 	uint64_t	zi_type; | 
| 92 | 	uint32_t	zi_freq; | 
| 93 | 	uint32_t	zi_failfast; | 
| 94 | } zinject_record_v15_t; | 
| 95 |  | 
| 96 | typedef struct zfs_cmd_v15 { | 
| 97 | 	char		zc_name[MAXPATHLEN]; | 
| 98 | 	char		zc_value[MAXPATHLEN]; | 
| 99 | 	char		zc_string[MAXNAMELEN]; | 
| 100 | 	uint64_t	zc_guid; | 
| 101 | 	uint64_t	zc_nvlist_conf;		/* really (char *) */ | 
| 102 | 	uint64_t	zc_nvlist_conf_size; | 
| 103 | 	uint64_t	zc_nvlist_src;		/* really (char *) */ | 
| 104 | 	uint64_t	zc_nvlist_src_size; | 
| 105 | 	uint64_t	zc_nvlist_dst;		/* really (char *) */ | 
| 106 | 	uint64_t	zc_nvlist_dst_size; | 
| 107 | 	uint64_t	zc_cookie; | 
| 108 | 	uint64_t	zc_objset_type; | 
| 109 | 	uint64_t	zc_perm_action; | 
| 110 | 	uint64_t 	zc_history;		/* really (char *) */ | 
| 111 | 	uint64_t 	zc_history_len; | 
| 112 | 	uint64_t	zc_history_offset; | 
| 113 | 	uint64_t	zc_obj; | 
| 114 | 	zfs_share_t	zc_share; | 
| 115 | 	uint64_t	zc_jailid; | 
| 116 | 	dmu_objset_stats_t zc_objset_stats; | 
| 117 | 	struct drr_begin zc_begin_record; | 
| 118 | 	zinject_record_v15_t zc_inject_record; | 
| 119 | } zfs_cmd_v15_t; | 
| 120 |  | 
| 121 | typedef struct zinject_record_v28 { | 
| 122 | 	uint64_t	zi_objset; | 
| 123 | 	uint64_t	zi_object; | 
| 124 | 	uint64_t	zi_start; | 
| 125 | 	uint64_t	zi_end; | 
| 126 | 	uint64_t	zi_guid; | 
| 127 | 	uint32_t	zi_level; | 
| 128 | 	uint32_t	zi_error; | 
| 129 | 	uint64_t	zi_type; | 
| 130 | 	uint32_t	zi_freq; | 
| 131 | 	uint32_t	zi_failfast; | 
| 132 | 	char		zi_func[MAXNAMELEN]; | 
| 133 | 	uint32_t	zi_iotype; | 
| 134 | 	int32_t		zi_duration; | 
| 135 | 	uint64_t	zi_timer; | 
| 136 | } zinject_record_v28_t; | 
| 137 |  | 
| 138 | typedef struct zfs_cmd_v28 { | 
| 139 | 	char		zc_name[MAXPATHLEN]; | 
| 140 | 	char		zc_value[MAXPATHLEN * 2]; | 
| 141 | 	char		zc_string[MAXNAMELEN]; | 
| 142 | 	char		zc_top_ds[MAXPATHLEN]; | 
| 143 | 	uint64_t	zc_guid; | 
| 144 | 	uint64_t	zc_nvlist_conf;		/* really (char *) */ | 
| 145 | 	uint64_t	zc_nvlist_conf_size; | 
| 146 | 	uint64_t	zc_nvlist_src;		/* really (char *) */ | 
| 147 | 	uint64_t	zc_nvlist_src_size; | 
| 148 | 	uint64_t	zc_nvlist_dst;		/* really (char *) */ | 
| 149 | 	uint64_t	zc_nvlist_dst_size; | 
| 150 | 	uint64_t	zc_cookie; | 
| 151 | 	uint64_t	zc_objset_type; | 
| 152 | 	uint64_t	zc_perm_action; | 
| 153 | 	uint64_t 	zc_history;		/* really (char *) */ | 
| 154 | 	uint64_t 	zc_history_len; | 
| 155 | 	uint64_t	zc_history_offset; | 
| 156 | 	uint64_t	zc_obj; | 
| 157 | 	uint64_t	zc_iflags;		/* internal to zfs(7fs) */ | 
| 158 | 	zfs_share_t	zc_share; | 
| 159 | 	uint64_t	zc_jailid; | 
| 160 | 	dmu_objset_stats_t zc_objset_stats; | 
| 161 | 	struct drr_begin zc_begin_record; | 
| 162 | 	zinject_record_v28_t zc_inject_record; | 
| 163 | 	boolean_t	zc_defer_destroy; | 
| 164 | 	boolean_t	zc_temphold; | 
| 165 | 	uint64_t	zc_action_handle; | 
| 166 | 	int		zc_cleanup_fd; | 
| 167 | 	uint8_t		zc_simple; | 
| 168 | 	uint8_t		zc_pad[3];		/* alignment */ | 
| 169 | 	uint64_t	zc_sendobj; | 
| 170 | 	uint64_t	zc_fromobj; | 
| 171 | 	uint64_t	zc_createtxg; | 
| 172 | 	zfs_stat_t	zc_stat; | 
| 173 | } zfs_cmd_v28_t; | 
| 174 |  | 
| 175 | typedef struct zinject_record_deadman { | 
| 176 | 	uint64_t	zi_objset; | 
| 177 | 	uint64_t	zi_object; | 
| 178 | 	uint64_t	zi_start; | 
| 179 | 	uint64_t	zi_end; | 
| 180 | 	uint64_t	zi_guid; | 
| 181 | 	uint32_t	zi_level; | 
| 182 | 	uint32_t	zi_error; | 
| 183 | 	uint64_t	zi_type; | 
| 184 | 	uint32_t	zi_freq; | 
| 185 | 	uint32_t	zi_failfast; | 
| 186 | 	char		zi_func[MAXNAMELEN]; | 
| 187 | 	uint32_t	zi_iotype; | 
| 188 | 	int32_t		zi_duration; | 
| 189 | 	uint64_t	zi_timer; | 
| 190 | 	uint32_t	zi_cmd; | 
| 191 | 	uint32_t	zi_pad; | 
| 192 | } zinject_record_deadman_t; | 
| 193 |  | 
| 194 | typedef struct zfs_cmd_deadman { | 
| 195 | 	char		zc_name[MAXPATHLEN]; | 
| 196 | 	char		zc_value[MAXPATHLEN * 2]; | 
| 197 | 	char		zc_string[MAXNAMELEN]; | 
| 198 | 	char		zc_top_ds[MAXPATHLEN]; | 
| 199 | 	uint64_t	zc_guid; | 
| 200 | 	uint64_t	zc_nvlist_conf;		/* really (char *) */ | 
| 201 | 	uint64_t	zc_nvlist_conf_size; | 
| 202 | 	uint64_t	zc_nvlist_src;		/* really (char *) */ | 
| 203 | 	uint64_t	zc_nvlist_src_size; | 
| 204 | 	uint64_t	zc_nvlist_dst;		/* really (char *) */ | 
| 205 | 	uint64_t	zc_nvlist_dst_size; | 
| 206 | 	uint64_t	zc_cookie; | 
| 207 | 	uint64_t	zc_objset_type; | 
| 208 | 	uint64_t	zc_perm_action; | 
| 209 | 	uint64_t 	zc_history;		/* really (char *) */ | 
| 210 | 	uint64_t 	zc_history_len; | 
| 211 | 	uint64_t	zc_history_offset; | 
| 212 | 	uint64_t	zc_obj; | 
| 213 | 	uint64_t	zc_iflags;		/* internal to zfs(7fs) */ | 
| 214 | 	zfs_share_t	zc_share; | 
| 215 | 	uint64_t	zc_jailid; | 
| 216 | 	dmu_objset_stats_t zc_objset_stats; | 
| 217 | 	struct drr_begin zc_begin_record; | 
| 218 | 	/* zc_inject_record doesn't change in libzfs_core */ | 
| 219 | 	zinject_record_deadman_t zc_inject_record; | 
| 220 | 	boolean_t	zc_defer_destroy; | 
| 221 | 	boolean_t	zc_temphold; | 
| 222 | 	uint64_t	zc_action_handle; | 
| 223 | 	int		zc_cleanup_fd; | 
| 224 | 	uint8_t		zc_simple; | 
| 225 | 	uint8_t		zc_pad[3];		/* alignment */ | 
| 226 | 	uint64_t	zc_sendobj; | 
| 227 | 	uint64_t	zc_fromobj; | 
| 228 | 	uint64_t	zc_createtxg; | 
| 229 | 	zfs_stat_t	zc_stat; | 
| 230 | } zfs_cmd_deadman_t; | 
| 231 |  | 
| 232 | typedef struct zfs_cmd_zcmd { | 
| 233 | 	char		zc_name[MAXPATHLEN];	/* name of pool or dataset */ | 
| 234 | 	uint64_t	zc_nvlist_src;		/* really (char *) */ | 
| 235 | 	uint64_t	zc_nvlist_src_size; | 
| 236 | 	uint64_t	zc_nvlist_dst;		/* really (char *) */ | 
| 237 | 	uint64_t	zc_nvlist_dst_size; | 
| 238 | 	boolean_t	zc_nvlist_dst_filled;	/* put an nvlist in dst? */ | 
| 239 | 	int		zc_pad2; | 
| 240 |  | 
| 241 | 	/* | 
| 242 | 	 * The following members are for legacy ioctls which haven't been | 
| 243 | 	 * converted to the new method. | 
| 244 | 	 */ | 
| 245 | 	uint64_t	zc_history;		/* really (char *) */ | 
| 246 | 	char		zc_value[MAXPATHLEN * 2]; | 
| 247 | 	char		zc_string[MAXNAMELEN]; | 
| 248 | 	uint64_t	zc_guid; | 
| 249 | 	uint64_t	zc_nvlist_conf;		/* really (char *) */ | 
| 250 | 	uint64_t	zc_nvlist_conf_size; | 
| 251 | 	uint64_t	zc_cookie; | 
| 252 | 	uint64_t	zc_objset_type; | 
| 253 | 	uint64_t	zc_perm_action; | 
| 254 | 	uint64_t	zc_history_len; | 
| 255 | 	uint64_t	zc_history_offset; | 
| 256 | 	uint64_t	zc_obj; | 
| 257 | 	uint64_t	zc_iflags;		/* internal to zfs(7fs) */ | 
| 258 | 	zfs_share_t	zc_share; | 
| 259 | 	uint64_t	zc_jailid; | 
| 260 | 	dmu_objset_stats_t zc_objset_stats; | 
| 261 | 	struct drr_begin zc_begin_record; | 
| 262 | 	zinject_record_deadman_t zc_inject_record; | 
| 263 | 	boolean_t	zc_defer_destroy; | 
| 264 | 	boolean_t	zc_temphold; | 
| 265 | 	uint64_t	zc_action_handle; | 
| 266 | 	int		zc_cleanup_fd; | 
| 267 | 	uint8_t		zc_simple; | 
| 268 | 	uint8_t		zc_pad[3];		/* alignment */ | 
| 269 | 	uint64_t	zc_sendobj; | 
| 270 | 	uint64_t	zc_fromobj; | 
| 271 | 	uint64_t	zc_createtxg; | 
| 272 | 	zfs_stat_t	zc_stat; | 
| 273 | } zfs_cmd_zcmd_t; | 
| 274 |  | 
| 275 | typedef struct zfs_cmd_edbp { | 
| 276 | 	char		zc_name[MAXPATHLEN];	/* name of pool or dataset */ | 
| 277 | 	uint64_t	zc_nvlist_src;		/* really (char *) */ | 
| 278 | 	uint64_t	zc_nvlist_src_size; | 
| 279 | 	uint64_t	zc_nvlist_dst;		/* really (char *) */ | 
| 280 | 	uint64_t	zc_nvlist_dst_size; | 
| 281 | 	boolean_t	zc_nvlist_dst_filled;	/* put an nvlist in dst? */ | 
| 282 | 	int		zc_pad2; | 
| 283 |  | 
| 284 | 	/* | 
| 285 | 	 * The following members are for legacy ioctls which haven't been | 
| 286 | 	 * converted to the new method. | 
| 287 | 	 */ | 
| 288 | 	uint64_t	zc_history;		/* really (char *) */ | 
| 289 | 	char		zc_value[MAXPATHLEN * 2]; | 
| 290 | 	char		zc_string[MAXNAMELEN]; | 
| 291 | 	uint64_t	zc_guid; | 
| 292 | 	uint64_t	zc_nvlist_conf;		/* really (char *) */ | 
| 293 | 	uint64_t	zc_nvlist_conf_size; | 
| 294 | 	uint64_t	zc_cookie; | 
| 295 | 	uint64_t	zc_objset_type; | 
| 296 | 	uint64_t	zc_perm_action; | 
| 297 | 	uint64_t	zc_history_len; | 
| 298 | 	uint64_t	zc_history_offset; | 
| 299 | 	uint64_t	zc_obj; | 
| 300 | 	uint64_t	zc_iflags;		/* internal to zfs(7fs) */ | 
| 301 | 	zfs_share_t	zc_share; | 
| 302 | 	uint64_t	zc_jailid; | 
| 303 | 	dmu_objset_stats_t zc_objset_stats; | 
| 304 | 	struct drr_begin zc_begin_record; | 
| 305 | 	zinject_record_deadman_t zc_inject_record; | 
| 306 | 	uint32_t	zc_defer_destroy; | 
| 307 | 	uint32_t	zc_flags; | 
| 308 | 	uint64_t	zc_action_handle; | 
| 309 | 	int		zc_cleanup_fd; | 
| 310 | 	uint8_t		zc_simple; | 
| 311 | 	uint8_t		zc_pad[3];		/* alignment */ | 
| 312 | 	uint64_t	zc_sendobj; | 
| 313 | 	uint64_t	zc_fromobj; | 
| 314 | 	uint64_t	zc_createtxg; | 
| 315 | 	zfs_stat_t	zc_stat; | 
| 316 | } zfs_cmd_edbp_t; | 
| 317 |  | 
| 318 | typedef struct zfs_cmd_resume { | 
| 319 | 	char		zc_name[MAXPATHLEN];	/* name of pool or dataset */ | 
| 320 | 	uint64_t	zc_nvlist_src;		/* really (char *) */ | 
| 321 | 	uint64_t	zc_nvlist_src_size; | 
| 322 | 	uint64_t	zc_nvlist_dst;		/* really (char *) */ | 
| 323 | 	uint64_t	zc_nvlist_dst_size; | 
| 324 | 	boolean_t	zc_nvlist_dst_filled;	/* put an nvlist in dst? */ | 
| 325 | 	int		zc_pad2; | 
| 326 |  | 
| 327 | 	/* | 
| 328 | 	 * The following members are for legacy ioctls which haven't been | 
| 329 | 	 * converted to the new method. | 
| 330 | 	 */ | 
| 331 | 	uint64_t	zc_history;		/* really (char *) */ | 
| 332 | 	char		zc_value[MAXPATHLEN * 2]; | 
| 333 | 	char		zc_string[MAXNAMELEN]; | 
| 334 | 	uint64_t	zc_guid; | 
| 335 | 	uint64_t	zc_nvlist_conf;		/* really (char *) */ | 
| 336 | 	uint64_t	zc_nvlist_conf_size; | 
| 337 | 	uint64_t	zc_cookie; | 
| 338 | 	uint64_t	zc_objset_type; | 
| 339 | 	uint64_t	zc_perm_action; | 
| 340 | 	uint64_t	zc_history_len; | 
| 341 | 	uint64_t	zc_history_offset; | 
| 342 | 	uint64_t	zc_obj; | 
| 343 | 	uint64_t	zc_iflags;		/* internal to zfs(7fs) */ | 
| 344 | 	zfs_share_t	zc_share; | 
| 345 | 	uint64_t	zc_jailid; | 
| 346 | 	dmu_objset_stats_t zc_objset_stats; | 
| 347 | 	dmu_replay_record_t zc_begin_record; | 
| 348 | 	zinject_record_deadman_t zc_inject_record; | 
| 349 | 	uint32_t	zc_defer_destroy; | 
| 350 | 	uint32_t	zc_flags; | 
| 351 | 	uint64_t	zc_action_handle; | 
| 352 | 	int		zc_cleanup_fd; | 
| 353 | 	uint8_t		zc_simple; | 
| 354 | 	boolean_t	zc_resumable; | 
| 355 | 	uint64_t	zc_sendobj; | 
| 356 | 	uint64_t	zc_fromobj; | 
| 357 | 	uint64_t	zc_createtxg; | 
| 358 | 	zfs_stat_t	zc_stat; | 
| 359 | } zfs_cmd_resume_t; | 
| 360 |  | 
| 361 | typedef struct zfs_cmd_inlanes { | 
| 362 | 	char		zc_name[MAXPATHLEN];	/* name of pool or dataset */ | 
| 363 | 	uint64_t	zc_nvlist_src;		/* really (char *) */ | 
| 364 | 	uint64_t	zc_nvlist_src_size; | 
| 365 | 	uint64_t	zc_nvlist_dst;		/* really (char *) */ | 
| 366 | 	uint64_t	zc_nvlist_dst_size; | 
| 367 | 	boolean_t	zc_nvlist_dst_filled;	/* put an nvlist in dst? */ | 
| 368 | 	int		zc_pad2; | 
| 369 |  | 
| 370 | 	/* | 
| 371 | 	 * The following members are for legacy ioctls which haven't been | 
| 372 | 	 * converted to the new method. | 
| 373 | 	 */ | 
| 374 | 	uint64_t	zc_history;		/* really (char *) */ | 
| 375 | 	char		zc_value[MAXPATHLEN * 2]; | 
| 376 | 	char		zc_string[MAXNAMELEN]; | 
| 377 | 	uint64_t	zc_guid; | 
| 378 | 	uint64_t	zc_nvlist_conf;		/* really (char *) */ | 
| 379 | 	uint64_t	zc_nvlist_conf_size; | 
| 380 | 	uint64_t	zc_cookie; | 
| 381 | 	uint64_t	zc_objset_type; | 
| 382 | 	uint64_t	zc_perm_action; | 
| 383 | 	uint64_t	zc_history_len; | 
| 384 | 	uint64_t	zc_history_offset; | 
| 385 | 	uint64_t	zc_obj; | 
| 386 | 	uint64_t	zc_iflags;		/* internal to zfs(7fs) */ | 
| 387 | 	zfs_share_t	zc_share; | 
| 388 | 	uint64_t	zc_jailid; | 
| 389 | 	dmu_objset_stats_t zc_objset_stats; | 
| 390 | 	dmu_replay_record_t zc_begin_record; | 
| 391 | 	zinject_record_t zc_inject_record; | 
| 392 | 	uint32_t	zc_defer_destroy; | 
| 393 | 	uint32_t	zc_flags; | 
| 394 | 	uint64_t	zc_action_handle; | 
| 395 | 	int		zc_cleanup_fd; | 
| 396 | 	uint8_t		zc_simple; | 
| 397 | 	boolean_t	zc_resumable; | 
| 398 | 	uint64_t	zc_sendobj; | 
| 399 | 	uint64_t	zc_fromobj; | 
| 400 | 	uint64_t	zc_createtxg; | 
| 401 | 	zfs_stat_t	zc_stat; | 
| 402 | } zfs_cmd_inlanes_t; | 
| 403 |  | 
| 404 | #ifdef _KERNEL | 
| 405 | static unsigned long zfs_ioctl_v15_to_v28[] = { | 
| 406 | 	0,	/*  0 ZFS_IOC_POOL_CREATE */ | 
| 407 | 	1,	/*  1 ZFS_IOC_POOL_DESTROY */ | 
| 408 | 	2,	/*  2 ZFS_IOC_POOL_IMPORT */ | 
| 409 | 	3,	/*  3 ZFS_IOC_POOL_EXPORT */ | 
| 410 | 	4,	/*  4 ZFS_IOC_POOL_CONFIGS */ | 
| 411 | 	5,	/*  5 ZFS_IOC_POOL_STATS */ | 
| 412 | 	6,	/*  6 ZFS_IOC_POOL_TRYIMPORT */ | 
| 413 | 	7,	/*  7 ZFS_IOC_POOL_SCRUB */ | 
| 414 | 	8,	/*  8 ZFS_IOC_POOL_FREEZE */ | 
| 415 | 	9,	/*  9 ZFS_IOC_POOL_UPGRADE */ | 
| 416 | 	10,	/* 10 ZFS_IOC_POOL_GET_HISTORY */ | 
| 417 | 	11,	/* 11 ZFS_IOC_VDEV_ADD */ | 
| 418 | 	12,	/* 12 ZFS_IOC_VDEV_REMOVE */ | 
| 419 | 	13,	/* 13 ZFS_IOC_VDEV_SET_STATE */ | 
| 420 | 	14,	/* 14 ZFS_IOC_VDEV_ATTACH */ | 
| 421 | 	15,	/* 15 ZFS_IOC_VDEV_DETACH */ | 
| 422 | 	16,	/* 16 ZFS_IOC_VDEV_SETPATH */ | 
| 423 | 	18,	/* 17 ZFS_IOC_OBJSET_STATS */ | 
| 424 | 	19,	/* 18 ZFS_IOC_OBJSET_ZPLPROPS */ | 
| 425 | 	20, 	/* 19 ZFS_IOC_DATASET_LIST_NEXT */ | 
| 426 | 	21,	/* 20 ZFS_IOC_SNAPSHOT_LIST_NEXT */ | 
| 427 | 	22,	/* 21 ZFS_IOC_SET_PROP */ | 
| 428 | 	ZFS_IOC_COMPAT_PASS,	/* 22 ZFS_IOC_CREATE_MINOR */ | 
| 429 | 	ZFS_IOC_COMPAT_PASS,	/* 23 ZFS_IOC_REMOVE_MINOR */ | 
| 430 | 	23,	/* 24 ZFS_IOC_CREATE */ | 
| 431 | 	24,	/* 25 ZFS_IOC_DESTROY */ | 
| 432 | 	25,	/* 26 ZFS_IOC_ROLLBACK */ | 
| 433 | 	26,	/* 27 ZFS_IOC_RENAME */ | 
| 434 | 	27,	/* 28 ZFS_IOC_RECV */ | 
| 435 | 	28,	/* 29 ZFS_IOC_SEND */ | 
| 436 | 	29,	/* 30 ZFS_IOC_INJECT_FAULT */ | 
| 437 | 	30,	/* 31 ZFS_IOC_CLEAR_FAULT */ | 
| 438 | 	31,	/* 32 ZFS_IOC_INJECT_LIST_NEXT */ | 
| 439 | 	32,	/* 33 ZFS_IOC_ERROR_LOG */ | 
| 440 | 	33,	/* 34 ZFS_IOC_CLEAR */ | 
| 441 | 	34,	/* 35 ZFS_IOC_PROMOTE */ | 
| 442 | 	35,	/* 36 ZFS_IOC_DESTROY_SNAPS */ | 
| 443 | 	36,	/* 37 ZFS_IOC_SNAPSHOT */ | 
| 444 | 	37,	/* 38 ZFS_IOC_DSOBJ_TO_DSNAME */ | 
| 445 | 	38,	/* 39 ZFS_IOC_OBJ_TO_PATH */ | 
| 446 | 	39,	/* 40 ZFS_IOC_POOL_SET_PROPS */ | 
| 447 | 	40,	/* 41 ZFS_IOC_POOL_GET_PROPS */ | 
| 448 | 	41,	/* 42 ZFS_IOC_SET_FSACL */ | 
| 449 | 	42,	/* 43 ZFS_IOC_GET_FSACL */ | 
| 450 | 	ZFS_IOC_COMPAT_PASS,	/* 44 ZFS_IOC_ISCSI_PERM_CHECK */ | 
| 451 | 	43,	/* 45 ZFS_IOC_SHARE */ | 
| 452 | 	44,	/* 46 ZFS_IOC_IHNERIT_PROP */ | 
| 453 | 	58,	/* 47 ZFS_IOC_JAIL */ | 
| 454 | 	59,	/* 48 ZFS_IOC_UNJAIL */ | 
| 455 | 	45,	/* 49 ZFS_IOC_SMB_ACL */ | 
| 456 | 	46,	/* 50 ZFS_IOC_USERSPACE_ONE */ | 
| 457 | 	47,	/* 51 ZFS_IOC_USERSPACE_MANY */ | 
| 458 | 	48,	/* 52 ZFS_IOC_USERSPACE_UPGRADE */ | 
| 459 | 	17,	/* 53 ZFS_IOC_SETFRU */ | 
| 460 | }; | 
| 461 |  | 
| 462 | #else	/* KERNEL */ | 
| 463 | static unsigned long zfs_ioctl_v28_to_v15[] = { | 
| 464 | 	0,	/*  0 ZFS_IOC_POOL_CREATE */ | 
| 465 | 	1,	/*  1 ZFS_IOC_POOL_DESTROY */ | 
| 466 | 	2,	/*  2 ZFS_IOC_POOL_IMPORT */ | 
| 467 | 	3,	/*  3 ZFS_IOC_POOL_EXPORT */ | 
| 468 | 	4,	/*  4 ZFS_IOC_POOL_CONFIGS */ | 
| 469 | 	5,	/*  5 ZFS_IOC_POOL_STATS */ | 
| 470 | 	6,	/*  6 ZFS_IOC_POOL_TRYIMPORT */ | 
| 471 | 	7,	/*  7 ZFS_IOC_POOL_SCAN */ | 
| 472 | 	8,	/*  8 ZFS_IOC_POOL_FREEZE */ | 
| 473 | 	9,	/*  9 ZFS_IOC_POOL_UPGRADE */ | 
| 474 | 	10,	/* 10 ZFS_IOC_POOL_GET_HISTORY */ | 
| 475 | 	11,	/* 11 ZFS_IOC_VDEV_ADD */ | 
| 476 | 	12,	/* 12 ZFS_IOC_VDEV_REMOVE */ | 
| 477 | 	13,	/* 13 ZFS_IOC_VDEV_SET_STATE */ | 
| 478 | 	14,	/* 14 ZFS_IOC_VDEV_ATTACH */ | 
| 479 | 	15,	/* 15 ZFS_IOC_VDEV_DETACH */ | 
| 480 | 	16,	/* 16 ZFS_IOC_VDEV_SETPATH */ | 
| 481 | 	53,	/* 17 ZFS_IOC_VDEV_SETFRU */ | 
| 482 | 	17,	/* 18 ZFS_IOC_OBJSET_STATS */ | 
| 483 | 	18,	/* 19 ZFS_IOC_OBJSET_ZPLPROPS */ | 
| 484 | 	19, 	/* 20 ZFS_IOC_DATASET_LIST_NEXT */ | 
| 485 | 	20,	/* 21 ZFS_IOC_SNAPSHOT_LIST_NEXT */ | 
| 486 | 	21,	/* 22 ZFS_IOC_SET_PROP */ | 
| 487 | 	24,	/* 23 ZFS_IOC_CREATE */ | 
| 488 | 	25,	/* 24 ZFS_IOC_DESTROY */ | 
| 489 | 	26,	/* 25 ZFS_IOC_ROLLBACK */ | 
| 490 | 	27,	/* 26 ZFS_IOC_RENAME */ | 
| 491 | 	28,	/* 27 ZFS_IOC_RECV */ | 
| 492 | 	29,	/* 28 ZFS_IOC_SEND */ | 
| 493 | 	30,	/* 39 ZFS_IOC_INJECT_FAULT */ | 
| 494 | 	31,	/* 30 ZFS_IOC_CLEAR_FAULT */ | 
| 495 | 	32,	/* 31 ZFS_IOC_INJECT_LIST_NEXT */ | 
| 496 | 	33,	/* 32 ZFS_IOC_ERROR_LOG */ | 
| 497 | 	34,	/* 33 ZFS_IOC_CLEAR */ | 
| 498 | 	35,	/* 34 ZFS_IOC_PROMOTE */ | 
| 499 | 	36,	/* 35 ZFS_IOC_DESTROY_SNAPS */ | 
| 500 | 	37,	/* 36 ZFS_IOC_SNAPSHOT */ | 
| 501 | 	38,	/* 37 ZFS_IOC_DSOBJ_TO_DSNAME */ | 
| 502 | 	39,	/* 38 ZFS_IOC_OBJ_TO_PATH */ | 
| 503 | 	40,	/* 39 ZFS_IOC_POOL_SET_PROPS */ | 
| 504 | 	41,	/* 40 ZFS_IOC_POOL_GET_PROPS */ | 
| 505 | 	42,	/* 41 ZFS_IOC_SET_FSACL */ | 
| 506 | 	43,	/* 42 ZFS_IOC_GET_FSACL */ | 
| 507 | 	45,	/* 43 ZFS_IOC_SHARE */ | 
| 508 | 	46,	/* 44 ZFS_IOC_IHNERIT_PROP */ | 
| 509 | 	49,	/* 45 ZFS_IOC_SMB_ACL */ | 
| 510 | 	50,	/* 46 ZFS_IOC_USERSPACE_ONE */ | 
| 511 | 	51,	/* 47 ZFS_IOC_USERSPACE_MANY */ | 
| 512 | 	52,	/* 48 ZFS_IOC_USERSPACE_UPGRADE */ | 
| 513 | 	ZFS_IOC_COMPAT_FAIL,	/* 49 ZFS_IOC_HOLD */ | 
| 514 | 	ZFS_IOC_COMPAT_FAIL,	/* 50 ZFS_IOC_RELEASE */ | 
| 515 | 	ZFS_IOC_COMPAT_FAIL,	/* 51 ZFS_IOC_GET_HOLDS */ | 
| 516 | 	ZFS_IOC_COMPAT_FAIL,	/* 52 ZFS_IOC_OBJSET_RECVD_PROPS */ | 
| 517 | 	ZFS_IOC_COMPAT_FAIL,	/* 53 ZFS_IOC_VDEV_SPLIT */ | 
| 518 | 	ZFS_IOC_COMPAT_FAIL,	/* 54 ZFS_IOC_NEXT_OBJ */ | 
| 519 | 	ZFS_IOC_COMPAT_FAIL,	/* 55 ZFS_IOC_DIFF */ | 
| 520 | 	ZFS_IOC_COMPAT_FAIL,	/* 56 ZFS_IOC_TMP_SNAPSHOT */ | 
| 521 | 	ZFS_IOC_COMPAT_FAIL,	/* 57 ZFS_IOC_OBJ_TO_STATS */ | 
| 522 | 	47,	/* 58 ZFS_IOC_JAIL */ | 
| 523 | 	48,	/* 59 ZFS_IOC_UNJAIL */ | 
| 524 | }; | 
| 525 | #endif	/* ! _KERNEL */ | 
| 526 |  | 
| 527 | #ifdef _KERNEL | 
| 528 | int zfs_ioctl_compat_pre(zfs_cmd_t *, int *, const int); | 
| 529 | void zfs_ioctl_compat_post(zfs_cmd_t *, const int, const int); | 
| 530 | nvlist_t *zfs_ioctl_compat_innvl(zfs_cmd_t *, nvlist_t *, const int, | 
| 531 |     const int); | 
| 532 | nvlist_t *zfs_ioctl_compat_outnvl(zfs_cmd_t *, nvlist_t *, const int, | 
| 533 |     const int); | 
| 534 | #else | 
| 535 | int zcmd_ioctl_compat(int, int, zfs_cmd_t *, const int); | 
| 536 | #endif	/* _KERNEL */ | 
| 537 | void zfs_cmd_compat_get(zfs_cmd_t *, caddr_t, const int); | 
| 538 | void zfs_cmd_compat_put(zfs_cmd_t *, caddr_t, const int, const int); | 
| 539 |  | 
| 540 | #ifdef	__cplusplus | 
| 541 | } | 
| 542 | #endif | 
| 543 |  | 
| 544 | #endif	/* _SYS_ZFS_IOCTL_COMPAT_H */ | 
| 545 |  |