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 (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
23 */
24
25 #ifndef _SYS_ZFS_IOCTL_H
26 #define _SYS_ZFS_IOCTL_H
27
28 #include <sys/cred.h>
29 #include <sys/dmu.h>
30 #include <sys/zio.h>
31 #include <sys/dsl_deleg.h>
32 #include <sys/spa.h>
33 #include <sys/zfs_stat.h>
34
35 #ifdef _KERNEL
36 #include <sys/nvpair.h>
37 #endif /* _KERNEL */
38
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42
43 /*
44 * Property values for snapdir
45 */
46 #define ZFS_SNAPDIR_HIDDEN 0
47 #define ZFS_SNAPDIR_VISIBLE 1
48
49 /*
50 * Field manipulation macros for the drr_versioninfo field of the
51 * send stream header.
52 */
53
54 /*
55 * Header types for zfs send streams.
56 */
57 typedef enum drr_headertype {
58 DMU_SUBSTREAM = 0x1,
59 DMU_COMPOUNDSTREAM = 0x2
60 } drr_headertype_t;
61
62 #define DMU_GET_STREAM_HDRTYPE(vi) BF64_GET((vi), 0, 2)
63 #define DMU_SET_STREAM_HDRTYPE(vi, x) BF64_SET((vi), 0, 2, x)
239 typedef struct zfs_share {
240 uint64_t z_exportdata;
241 uint64_t z_sharedata;
242 uint64_t z_sharetype; /* 0 = share, 1 = unshare */
243 uint64_t z_sharemax; /* max length of share string */
244 } zfs_share_t;
245
246 /*
247 * ZFS file systems may behave the usual, POSIX-compliant way, where
248 * name lookups are case-sensitive. They may also be set up so that
249 * all the name lookups are case-insensitive, or so that only some
250 * lookups, the ones that set an FIGNORECASE flag, are case-insensitive.
251 */
252 typedef enum zfs_case {
253 ZFS_CASE_SENSITIVE,
254 ZFS_CASE_INSENSITIVE,
255 ZFS_CASE_MIXED
256 } zfs_case_t;
257
258 typedef struct zfs_cmd {
259 char zc_name[MAXPATHLEN];
260 char zc_value[MAXPATHLEN * 2];
261 char zc_string[MAXNAMELEN];
262 char zc_top_ds[MAXPATHLEN];
263 uint64_t zc_guid;
264 uint64_t zc_nvlist_conf; /* really (char *) */
265 uint64_t zc_nvlist_conf_size;
266 uint64_t zc_nvlist_src; /* really (char *) */
267 uint64_t zc_nvlist_src_size;
268 uint64_t zc_nvlist_dst; /* really (char *) */
269 uint64_t zc_nvlist_dst_size;
270 uint64_t zc_cookie;
271 uint64_t zc_objset_type;
272 uint64_t zc_perm_action;
273 uint64_t zc_history; /* really (char *) */
274 uint64_t zc_history_len;
275 uint64_t zc_history_offset;
276 uint64_t zc_obj;
277 uint64_t zc_iflags; /* internal to zfs(7fs) */
278 zfs_share_t zc_share;
279 dmu_objset_stats_t zc_objset_stats;
280 struct drr_begin zc_begin_record;
281 zinject_record_t zc_inject_record;
282 boolean_t zc_defer_destroy;
283 boolean_t zc_temphold;
284 uint64_t zc_action_handle;
285 int zc_cleanup_fd;
286 uint8_t zc_pad[4]; /* alignment */
287 uint64_t zc_sendobj;
288 uint64_t zc_fromobj;
289 uint64_t zc_createtxg;
290 zfs_stat_t zc_stat;
291 } zfs_cmd_t;
292
293 typedef struct zfs_useracct {
|
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 (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
23 * Copyright (c) 2012 by Delphix. All rights reserved.
24 */
25
26 #ifndef _SYS_ZFS_IOCTL_H
27 #define _SYS_ZFS_IOCTL_H
28
29 #include <sys/cred.h>
30 #include <sys/dmu.h>
31 #include <sys/zio.h>
32 #include <sys/dsl_deleg.h>
33 #include <sys/spa.h>
34 #include <sys/zfs_stat.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 * The structures in this file are passed between userland and the
46 * kernel. Userland may be running a 32-bit process, while the kernel
47 * is 64-bit. Therefore, these structures need to compile the same in
48 * 32-bit and 64-bit. This means not using type "long", and adding
49 * explicit padding so that the 32-bit structure will not be packed more
50 * tightly than the 64-bit structure (which requires 64-bit alignment).
51 */
52
53 /*
54 * Property values for snapdir
55 */
56 #define ZFS_SNAPDIR_HIDDEN 0
57 #define ZFS_SNAPDIR_VISIBLE 1
58
59 /*
60 * Field manipulation macros for the drr_versioninfo field of the
61 * send stream header.
62 */
63
64 /*
65 * Header types for zfs send streams.
66 */
67 typedef enum drr_headertype {
68 DMU_SUBSTREAM = 0x1,
69 DMU_COMPOUNDSTREAM = 0x2
70 } drr_headertype_t;
71
72 #define DMU_GET_STREAM_HDRTYPE(vi) BF64_GET((vi), 0, 2)
73 #define DMU_SET_STREAM_HDRTYPE(vi, x) BF64_SET((vi), 0, 2, x)
249 typedef struct zfs_share {
250 uint64_t z_exportdata;
251 uint64_t z_sharedata;
252 uint64_t z_sharetype; /* 0 = share, 1 = unshare */
253 uint64_t z_sharemax; /* max length of share string */
254 } zfs_share_t;
255
256 /*
257 * ZFS file systems may behave the usual, POSIX-compliant way, where
258 * name lookups are case-sensitive. They may also be set up so that
259 * all the name lookups are case-insensitive, or so that only some
260 * lookups, the ones that set an FIGNORECASE flag, are case-insensitive.
261 */
262 typedef enum zfs_case {
263 ZFS_CASE_SENSITIVE,
264 ZFS_CASE_INSENSITIVE,
265 ZFS_CASE_MIXED
266 } zfs_case_t;
267
268 typedef struct zfs_cmd {
269 char zc_name[MAXPATHLEN]; /* name of pool or dataset */
270 uint64_t zc_nvlist_src; /* really (char *) */
271 uint64_t zc_nvlist_src_size;
272 uint64_t zc_nvlist_dst; /* really (char *) */
273 uint64_t zc_nvlist_dst_size;
274 boolean_t zc_nvlist_dst_filled; /* put an nvlist in dst? */
275 int zc_pad2;
276
277 /*
278 * The following members are for legacy ioctls which haven't been
279 * converted to the new method.
280 */
281 uint64_t zc_history; /* really (char *) */
282 char zc_value[MAXPATHLEN * 2];
283 char zc_string[MAXNAMELEN];
284 char zc_top_ds[MAXPATHLEN];
285 uint64_t zc_guid;
286 uint64_t zc_nvlist_conf; /* really (char *) */
287 uint64_t zc_nvlist_conf_size;
288 uint64_t zc_cookie;
289 uint64_t zc_objset_type;
290 uint64_t zc_perm_action;
291 uint64_t zc_history_len;
292 uint64_t zc_history_offset;
293 uint64_t zc_obj;
294 uint64_t zc_iflags; /* internal to zfs(7fs) */
295 zfs_share_t zc_share;
296 dmu_objset_stats_t zc_objset_stats;
297 struct drr_begin zc_begin_record;
298 zinject_record_t zc_inject_record;
299 boolean_t zc_defer_destroy;
300 boolean_t zc_temphold;
301 uint64_t zc_action_handle;
302 int zc_cleanup_fd;
303 uint8_t zc_pad[4]; /* alignment */
304 uint64_t zc_sendobj;
305 uint64_t zc_fromobj;
306 uint64_t zc_createtxg;
307 zfs_stat_t zc_stat;
308 } zfs_cmd_t;
309
310 typedef struct zfs_useracct {
|