]> git.proxmox.com Git - mirror_zfs.git/blob - include/os/freebsd/zfs/sys/zfs_ioctl_compat.h
a8db8bee520940fc1af2438bb7aeef6aebfa1a5a
[mirror_zfs.git] / include / os / freebsd / zfs / sys / zfs_ioctl_compat.h
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/dmu.h>
32 #include <sys/zio.h>
33 #include <sys/dsl_deleg.h>
34 #include <sys/zfs_ioctl.h>
35
36 #ifdef _KERNEL
37 #include <sys/nvpair.h>
38 #endif /* _KERNEL */
39
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43
44 /*
45 * Backwards ioctl compatibility
46 */
47
48 /* ioctl versions for vfs.zfs.version.ioctl */
49 #define ZFS_IOCVER_UNDEF -1
50 #define ZFS_IOCVER_NONE 0
51 #define ZFS_IOCVER_DEADMAN 1
52 #define ZFS_IOCVER_LZC 2
53 #define ZFS_IOCVER_ZCMD 3
54 #define ZFS_IOCVER_EDBP 4
55 #define ZFS_IOCVER_RESUME 5
56 #define ZFS_IOCVER_INLANES 6
57 #define ZFS_IOCVER_PAD 7
58 #define ZFS_IOCVER_FREEBSD ZFS_IOCVER_PAD
59 #define ZFS_IOCVER_ZOF 15
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 /*
406 * Note: this struct must have the same layout in 32-bit and 64-bit, so
407 * that 32-bit processes (like /sbin/zfs) can pass it to the 64-bit
408 * kernel. Therefore, we add padding to it so that no "hidden" padding
409 * is automatically added on 64-bit (but not on 32-bit).
410 */
411 typedef struct zfs_cmd_legacy {
412 char zc_name[MAXPATHLEN]; /* name of pool or dataset */
413 uint64_t zc_nvlist_src; /* really (char *) */
414 uint64_t zc_nvlist_src_size;
415 uint64_t zc_nvlist_dst; /* really (char *) */
416 uint64_t zc_nvlist_dst_size;
417 boolean_t zc_nvlist_dst_filled; /* put an nvlist in dst? */
418 int zc_pad2;
419
420 /*
421 * The following members are for legacy ioctls which haven't been
422 * converted to the new method.
423 */
424 uint64_t zc_history; /* really (char *) */
425 char zc_value[MAXPATHLEN * 2];
426 char zc_string[MAXNAMELEN];
427 uint64_t zc_guid;
428 uint64_t zc_nvlist_conf; /* really (char *) */
429 uint64_t zc_nvlist_conf_size;
430 uint64_t zc_cookie;
431 uint64_t zc_objset_type;
432 uint64_t zc_perm_action;
433 uint64_t zc_history_len;
434 uint64_t zc_history_offset;
435 uint64_t zc_obj;
436 uint64_t zc_iflags; /* internal to zfs(7fs) */
437 zfs_share_t zc_share;
438 uint64_t zc_jailid;
439
440 dmu_objset_stats_t zc_objset_stats;
441 uint64_t zc_freebsd_drr_pad;
442 struct drr_begin zc_begin_record;
443 zinject_record_t zc_inject_record;
444 uint32_t zc_defer_destroy;
445 uint32_t zc_flags;
446 uint64_t zc_action_handle;
447 int zc_cleanup_fd;
448 uint8_t zc_simple;
449 uint8_t zc_pad3[3];
450 boolean_t zc_resumable;
451 uint32_t zc_pad4;
452 uint64_t zc_sendobj;
453 uint64_t zc_fromobj;
454 uint64_t zc_createtxg;
455 zfs_stat_t zc_stat;
456 } zfs_cmd_legacy_t;
457
458 unsigned static long zfs_ioctl_bsd12_to_zof[] = {
459 ZFS_IOC_POOL_CREATE, /* 0x00 */
460 ZFS_IOC_POOL_DESTROY, /* 0x01 */
461 ZFS_IOC_POOL_IMPORT, /* 0x02 */
462 ZFS_IOC_POOL_EXPORT, /* 0x03 */
463 ZFS_IOC_POOL_CONFIGS, /* 0x04 */
464 ZFS_IOC_POOL_STATS, /* 0x05 */
465 ZFS_IOC_POOL_TRYIMPORT, /* 0x06 */
466 ZFS_IOC_POOL_SCAN, /* 0x07 */
467 ZFS_IOC_POOL_FREEZE, /* 0x08 */
468 ZFS_IOC_POOL_UPGRADE, /* 0x09 */
469 ZFS_IOC_POOL_GET_HISTORY, /* 0x0a */
470 ZFS_IOC_VDEV_ADD, /* 0x0b */
471 ZFS_IOC_VDEV_REMOVE, /* 0x0c */
472 ZFS_IOC_VDEV_SET_STATE, /* 0x0d */
473 ZFS_IOC_VDEV_ATTACH, /* 0x0e */
474 ZFS_IOC_VDEV_DETACH, /* 0x0f */
475 ZFS_IOC_VDEV_SETPATH, /* 0x10 */
476 ZFS_IOC_VDEV_SETFRU, /* 0x11 */
477 ZFS_IOC_OBJSET_STATS, /* 0x12 */
478 ZFS_IOC_OBJSET_ZPLPROPS, /* 0x13 */
479 ZFS_IOC_DATASET_LIST_NEXT, /* 0x14 */
480 ZFS_IOC_SNAPSHOT_LIST_NEXT, /* 0x15 */
481 ZFS_IOC_SET_PROP, /* 0x16 */
482 ZFS_IOC_CREATE, /* 0x17 */
483 ZFS_IOC_DESTROY, /* 0x18 */
484 ZFS_IOC_ROLLBACK, /* 0x19 */
485 ZFS_IOC_RENAME, /* 0x1a */
486 ZFS_IOC_RECV, /* 0x1b */
487 ZFS_IOC_SEND, /* 0x1c */
488 ZFS_IOC_INJECT_FAULT, /* 0x1d */
489 ZFS_IOC_CLEAR_FAULT, /* 0x1e */
490 ZFS_IOC_INJECT_LIST_NEXT, /* 0x1f */
491 ZFS_IOC_ERROR_LOG, /* 0x20 */
492 ZFS_IOC_CLEAR, /* 0x21 */
493 ZFS_IOC_PROMOTE, /* 0x22 */
494 /* start of mismatch */
495 ZFS_IOC_DESTROY_SNAPS, /* 0x23:0x3b */
496 ZFS_IOC_SNAPSHOT, /* 0x24:0x23 */
497 ZFS_IOC_DSOBJ_TO_DSNAME, /* 0x25:0x24 */
498 ZFS_IOC_OBJ_TO_PATH, /* 0x26:0x25 */
499 ZFS_IOC_POOL_SET_PROPS, /* 0x27:0x26 */
500 ZFS_IOC_POOL_GET_PROPS, /* 0x28:0x27 */
501 ZFS_IOC_SET_FSACL, /* 0x29:0x28 */
502 ZFS_IOC_GET_FSACL, /* 0x30:0x29 */
503 ZFS_IOC_SHARE, /* 0x2b:0x2a */
504 ZFS_IOC_INHERIT_PROP, /* 0x2c:0x2b */
505 ZFS_IOC_SMB_ACL, /* 0x2d:0x2c */
506 ZFS_IOC_USERSPACE_ONE, /* 0x2e:0x2d */
507 ZFS_IOC_USERSPACE_MANY, /* 0x2f:0x2e */
508 ZFS_IOC_USERSPACE_UPGRADE, /* 0x30:0x2f */
509 ZFS_IOC_HOLD, /* 0x31:0x30 */
510 ZFS_IOC_RELEASE, /* 0x32:0x31 */
511 ZFS_IOC_GET_HOLDS, /* 0x33:0x32 */
512 ZFS_IOC_OBJSET_RECVD_PROPS, /* 0x34:0x33 */
513 ZFS_IOC_VDEV_SPLIT, /* 0x35:0x34 */
514 ZFS_IOC_NEXT_OBJ, /* 0x36:0x35 */
515 ZFS_IOC_DIFF, /* 0x37:0x36 */
516 ZFS_IOC_TMP_SNAPSHOT, /* 0x38:0x37 */
517 ZFS_IOC_OBJ_TO_STATS, /* 0x39:0x38 */
518 ZFS_IOC_JAIL, /* 0x3a:0xc2 */
519 ZFS_IOC_UNJAIL, /* 0x3b:0xc3 */
520 ZFS_IOC_POOL_REGUID, /* 0x3c:0x3c */
521 ZFS_IOC_SPACE_WRITTEN, /* 0x3d:0x39 */
522 ZFS_IOC_SPACE_SNAPS, /* 0x3e:0x3a */
523 ZFS_IOC_SEND_PROGRESS, /* 0x3f:0x3e */
524 ZFS_IOC_POOL_REOPEN, /* 0x40:0x3d */
525 ZFS_IOC_LOG_HISTORY, /* 0x41:0x3f */
526 ZFS_IOC_SEND_NEW, /* 0x42:0x40 */
527 ZFS_IOC_SEND_SPACE, /* 0x43:0x41 */
528 ZFS_IOC_CLONE, /* 0x44:0x42 */
529 ZFS_IOC_BOOKMARK, /* 0x45:0x43 */
530 ZFS_IOC_GET_BOOKMARKS, /* 0x46:0x44 */
531 ZFS_IOC_DESTROY_BOOKMARKS, /* 0x47:0x45 */
532 ZFS_IOC_NEXTBOOT, /* 0x48:0xc1 */
533 ZFS_IOC_CHANNEL_PROGRAM, /* 0x49:0x48 */
534 ZFS_IOC_REMAP, /* 0x4a:0x4c */
535 ZFS_IOC_POOL_CHECKPOINT, /* 0x4b:0x4d */
536 ZFS_IOC_POOL_DISCARD_CHECKPOINT, /* 0x4c:0x4e */
537 ZFS_IOC_POOL_INITIALIZE, /* 0x4d:0x4f */
538 };
539
540 unsigned static long zfs_ioctl_v15_to_v28[] = {
541 0, /* 0 ZFS_IOC_POOL_CREATE */
542 1, /* 1 ZFS_IOC_POOL_DESTROY */
543 2, /* 2 ZFS_IOC_POOL_IMPORT */
544 3, /* 3 ZFS_IOC_POOL_EXPORT */
545 4, /* 4 ZFS_IOC_POOL_CONFIGS */
546 5, /* 5 ZFS_IOC_POOL_STATS */
547 6, /* 6 ZFS_IOC_POOL_TRYIMPORT */
548 7, /* 7 ZFS_IOC_POOL_SCRUB */
549 8, /* 8 ZFS_IOC_POOL_FREEZE */
550 9, /* 9 ZFS_IOC_POOL_UPGRADE */
551 10, /* 10 ZFS_IOC_POOL_GET_HISTORY */
552 11, /* 11 ZFS_IOC_VDEV_ADD */
553 12, /* 12 ZFS_IOC_VDEV_REMOVE */
554 13, /* 13 ZFS_IOC_VDEV_SET_STATE */
555 14, /* 14 ZFS_IOC_VDEV_ATTACH */
556 15, /* 15 ZFS_IOC_VDEV_DETACH */
557 16, /* 16 ZFS_IOC_VDEV_SETPATH */
558 18, /* 17 ZFS_IOC_OBJSET_STATS */
559 19, /* 18 ZFS_IOC_OBJSET_ZPLPROPS */
560 20, /* 19 ZFS_IOC_DATASET_LIST_NEXT */
561 21, /* 20 ZFS_IOC_SNAPSHOT_LIST_NEXT */
562 22, /* 21 ZFS_IOC_SET_PROP */
563 ZFS_IOC_COMPAT_PASS, /* 22 ZFS_IOC_CREATE_MINOR */
564 ZFS_IOC_COMPAT_PASS, /* 23 ZFS_IOC_REMOVE_MINOR */
565 23, /* 24 ZFS_IOC_CREATE */
566 24, /* 25 ZFS_IOC_DESTROY */
567 25, /* 26 ZFS_IOC_ROLLBACK */
568 26, /* 27 ZFS_IOC_RENAME */
569 27, /* 28 ZFS_IOC_RECV */
570 28, /* 29 ZFS_IOC_SEND */
571 29, /* 30 ZFS_IOC_INJECT_FAULT */
572 30, /* 31 ZFS_IOC_CLEAR_FAULT */
573 31, /* 32 ZFS_IOC_INJECT_LIST_NEXT */
574 32, /* 33 ZFS_IOC_ERROR_LOG */
575 33, /* 34 ZFS_IOC_CLEAR */
576 34, /* 35 ZFS_IOC_PROMOTE */
577 35, /* 36 ZFS_IOC_DESTROY_SNAPS */
578 36, /* 37 ZFS_IOC_SNAPSHOT */
579 37, /* 38 ZFS_IOC_DSOBJ_TO_DSNAME */
580 38, /* 39 ZFS_IOC_OBJ_TO_PATH */
581 39, /* 40 ZFS_IOC_POOL_SET_PROPS */
582 40, /* 41 ZFS_IOC_POOL_GET_PROPS */
583 41, /* 42 ZFS_IOC_SET_FSACL */
584 42, /* 43 ZFS_IOC_GET_FSACL */
585 ZFS_IOC_COMPAT_PASS, /* 44 ZFS_IOC_ISCSI_PERM_CHECK */
586 43, /* 45 ZFS_IOC_SHARE */
587 44, /* 46 ZFS_IOC_IHNERIT_PROP */
588 58, /* 47 ZFS_IOC_JAIL */
589 59, /* 48 ZFS_IOC_UNJAIL */
590 45, /* 49 ZFS_IOC_SMB_ACL */
591 46, /* 50 ZFS_IOC_USERSPACE_ONE */
592 47, /* 51 ZFS_IOC_USERSPACE_MANY */
593 48, /* 52 ZFS_IOC_USERSPACE_UPGRADE */
594 17, /* 53 ZFS_IOC_SETFRU */
595 };
596
597 #else /* KERNEL */
598 unsigned static long zfs_ioctl_v28_to_v15[] = {
599 0, /* 0 ZFS_IOC_POOL_CREATE */
600 1, /* 1 ZFS_IOC_POOL_DESTROY */
601 2, /* 2 ZFS_IOC_POOL_IMPORT */
602 3, /* 3 ZFS_IOC_POOL_EXPORT */
603 4, /* 4 ZFS_IOC_POOL_CONFIGS */
604 5, /* 5 ZFS_IOC_POOL_STATS */
605 6, /* 6 ZFS_IOC_POOL_TRYIMPORT */
606 7, /* 7 ZFS_IOC_POOL_SCAN */
607 8, /* 8 ZFS_IOC_POOL_FREEZE */
608 9, /* 9 ZFS_IOC_POOL_UPGRADE */
609 10, /* 10 ZFS_IOC_POOL_GET_HISTORY */
610 11, /* 11 ZFS_IOC_VDEV_ADD */
611 12, /* 12 ZFS_IOC_VDEV_REMOVE */
612 13, /* 13 ZFS_IOC_VDEV_SET_STATE */
613 14, /* 14 ZFS_IOC_VDEV_ATTACH */
614 15, /* 15 ZFS_IOC_VDEV_DETACH */
615 16, /* 16 ZFS_IOC_VDEV_SETPATH */
616 53, /* 17 ZFS_IOC_VDEV_SETFRU */
617 17, /* 18 ZFS_IOC_OBJSET_STATS */
618 18, /* 19 ZFS_IOC_OBJSET_ZPLPROPS */
619 19, /* 20 ZFS_IOC_DATASET_LIST_NEXT */
620 20, /* 21 ZFS_IOC_SNAPSHOT_LIST_NEXT */
621 21, /* 22 ZFS_IOC_SET_PROP */
622 24, /* 23 ZFS_IOC_CREATE */
623 25, /* 24 ZFS_IOC_DESTROY */
624 26, /* 25 ZFS_IOC_ROLLBACK */
625 27, /* 26 ZFS_IOC_RENAME */
626 28, /* 27 ZFS_IOC_RECV */
627 29, /* 28 ZFS_IOC_SEND */
628 30, /* 39 ZFS_IOC_INJECT_FAULT */
629 31, /* 30 ZFS_IOC_CLEAR_FAULT */
630 32, /* 31 ZFS_IOC_INJECT_LIST_NEXT */
631 33, /* 32 ZFS_IOC_ERROR_LOG */
632 34, /* 33 ZFS_IOC_CLEAR */
633 35, /* 34 ZFS_IOC_PROMOTE */
634 36, /* 35 ZFS_IOC_DESTROY_SNAPS */
635 37, /* 36 ZFS_IOC_SNAPSHOT */
636 38, /* 37 ZFS_IOC_DSOBJ_TO_DSNAME */
637 39, /* 38 ZFS_IOC_OBJ_TO_PATH */
638 40, /* 39 ZFS_IOC_POOL_SET_PROPS */
639 41, /* 40 ZFS_IOC_POOL_GET_PROPS */
640 42, /* 41 ZFS_IOC_SET_FSACL */
641 43, /* 42 ZFS_IOC_GET_FSACL */
642 45, /* 43 ZFS_IOC_SHARE */
643 46, /* 44 ZFS_IOC_IHNERIT_PROP */
644 49, /* 45 ZFS_IOC_SMB_ACL */
645 50, /* 46 ZFS_IOC_USERSPACE_ONE */
646 51, /* 47 ZFS_IOC_USERSPACE_MANY */
647 52, /* 48 ZFS_IOC_USERSPACE_UPGRADE */
648 ZFS_IOC_COMPAT_FAIL, /* 49 ZFS_IOC_HOLD */
649 ZFS_IOC_COMPAT_FAIL, /* 50 ZFS_IOC_RELEASE */
650 ZFS_IOC_COMPAT_FAIL, /* 51 ZFS_IOC_GET_HOLDS */
651 ZFS_IOC_COMPAT_FAIL, /* 52 ZFS_IOC_OBJSET_RECVD_PROPS */
652 ZFS_IOC_COMPAT_FAIL, /* 53 ZFS_IOC_VDEV_SPLIT */
653 ZFS_IOC_COMPAT_FAIL, /* 54 ZFS_IOC_NEXT_OBJ */
654 ZFS_IOC_COMPAT_FAIL, /* 55 ZFS_IOC_DIFF */
655 ZFS_IOC_COMPAT_FAIL, /* 56 ZFS_IOC_TMP_SNAPSHOT */
656 ZFS_IOC_COMPAT_FAIL, /* 57 ZFS_IOC_OBJ_TO_STATS */
657 47, /* 58 ZFS_IOC_JAIL */
658 48, /* 59 ZFS_IOC_UNJAIL */
659 };
660 #endif /* ! _KERNEL */
661
662 #ifdef _KERNEL
663 int zfs_ioctl_compat_pre(zfs_cmd_t *, int *, const int);
664 void zfs_ioctl_compat_post(zfs_cmd_t *, const int, const int);
665 nvlist_t *zfs_ioctl_compat_innvl(zfs_cmd_t *, nvlist_t *, const int,
666 const int);
667 nvlist_t *zfs_ioctl_compat_outnvl(zfs_cmd_t *, nvlist_t *, const int,
668 const int);
669 #endif /* _KERNEL */
670 void zfs_cmd_compat_get(zfs_cmd_t *, caddr_t, const int);
671 void zfs_cmd_compat_put(zfs_cmd_t *, caddr_t, const int, const int);
672
673 #ifdef __cplusplus
674 }
675 #endif
676
677 #endif /* _SYS_ZFS_IOCTL_COMPAT_H */