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.
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.
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]
22 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #ifndef _SYS_ZFS_IOCTL_H
27 #define _SYS_ZFS_IOCTL_H
29 #pragma ident "%Z%%M% %I% %E% SMI"
40 * Property values for snapdir
42 #define ZFS_SNAPDIR_HIDDEN 0
43 #define ZFS_SNAPDIR_VISIBLE 1
45 #define DMU_BACKUP_VERSION (1ULL)
46 #define DMU_BACKUP_MAGIC 0x2F5bacbacULL
49 * zfs ioctl command structure
51 typedef struct dmu_replay_record {
53 DRR_BEGIN, DRR_OBJECT, DRR_FREEOBJECTS,
54 DRR_WRITE, DRR_FREE, DRR_END,
61 uint64_t drr_creation_time;
62 dmu_objset_type_t drr_type;
65 uint64_t drr_fromguid;
66 char drr_toname[MAXNAMELEN];
69 zio_cksum_t drr_checksum;
73 dmu_object_type_t drr_type;
74 dmu_object_type_t drr_bonustype;
76 uint32_t drr_bonuslen;
80 /* bonus content follows */
82 struct drr_freeobjects {
83 uint64_t drr_firstobj;
88 dmu_object_type_t drr_type;
100 } dmu_replay_record_t;
102 typedef struct zinject_record {
114 #define ZINJECT_NULL 0x1
115 #define ZINJECT_FLUSH_ARC 0x2
116 #define ZINJECT_UNLOAD_SPA 0x4
118 typedef struct zfs_cmd {
119 char zc_name[MAXPATHLEN];
120 char zc_value[MAXPATHLEN * 2];
122 uint64_t zc_nvlist_src; /* really (char *) */
123 uint64_t zc_nvlist_src_size;
124 uint64_t zc_nvlist_dst; /* really (char *) */
125 uint64_t zc_nvlist_dst_size;
129 uint64_t zc_objset_type;
130 uint64_t zc_history; /* really (char *) */
131 uint64_t zc_history_len;
132 uint64_t zc_history_offset;
135 dmu_objset_stats_t zc_objset_stats;
136 struct drr_begin zc_begin_record;
137 zinject_record_t zc_inject_record;
141 typedef struct zfs_create_data {
148 #define ZVOL_MAX_MINOR (1 << 16)
149 #define ZFS_MIN_MINOR (ZVOL_MAX_MINOR + 1)
153 extern int zfs_secpolicy_write(const char *dataset, cred_t *cr);
154 extern int zfs_busy(void);
155 extern int zfs_unmount_snap(char *, void *);
163 #endif /* _SYS_ZFS_IOCTL_H */