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