]>
Commit | Line | Data |
---|---|---|
34dc7c2f BB |
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 | */ | |
45d1cae3 | 21 | |
34dc7c2f | 22 | /* |
428870ff | 23 | * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. |
faf0f58c | 24 | * Copyright (c) 2011, 2014 by Delphix. All rights reserved. |
3541dc6d | 25 | * Copyright 2011 Nexenta Systems, Inc. All rights reserved. |
12fa0466 DE |
26 | * Copyright (c) 2013, 2017 Joyent, Inc. All rights reserved. |
27 | * Copyright (c) 2014 Integros [integros.com] | |
bec1067d | 28 | * Copyright (c) 2017 Datto Inc. |
34dc7c2f BB |
29 | */ |
30 | ||
428870ff BB |
31 | /* Portions Copyright 2010 Robert Milkowski */ |
32 | ||
34dc7c2f BB |
33 | #ifndef _SYS_FS_ZFS_H |
34 | #define _SYS_FS_ZFS_H | |
35 | ||
45d1cae3 | 36 | #include <sys/time.h> |
193a37cb | 37 | #include <sys/zio_priority.h> |
45d1cae3 | 38 | |
34dc7c2f BB |
39 | #ifdef __cplusplus |
40 | extern "C" { | |
41 | #endif | |
42 | ||
43 | /* | |
44 | * Types and constants shared between userland and the kernel. | |
45 | */ | |
46 | ||
47 | /* | |
48 | * Each dataset can be one of the following types. These constants can be | |
49 | * combined into masks that can be passed to various functions. | |
50 | */ | |
51 | typedef enum { | |
da536844 MA |
52 | ZFS_TYPE_FILESYSTEM = (1 << 0), |
53 | ZFS_TYPE_SNAPSHOT = (1 << 1), | |
54 | ZFS_TYPE_VOLUME = (1 << 2), | |
55 | ZFS_TYPE_POOL = (1 << 3), | |
56 | ZFS_TYPE_BOOKMARK = (1 << 4) | |
34dc7c2f BB |
57 | } zfs_type_t; |
58 | ||
e67a7ffb GM |
59 | /* |
60 | * NB: lzc_dataset_type should be updated whenever a new objset type is added, | |
61 | * if it represents a real type of a dataset that can be created from userland. | |
62 | */ | |
6f1ffb06 MA |
63 | typedef enum dmu_objset_type { |
64 | DMU_OST_NONE, | |
65 | DMU_OST_META, | |
66 | DMU_OST_ZFS, | |
67 | DMU_OST_ZVOL, | |
68 | DMU_OST_OTHER, /* For testing only! */ | |
69 | DMU_OST_ANY, /* Be careful! */ | |
70 | DMU_OST_NUMTYPES | |
71 | } dmu_objset_type_t; | |
72 | ||
34dc7c2f BB |
73 | #define ZFS_TYPE_DATASET \ |
74 | (ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME | ZFS_TYPE_SNAPSHOT) | |
75 | ||
eca7b760 IK |
76 | /* |
77 | * All of these include the terminating NUL byte. | |
78 | */ | |
9babb374 BB |
79 | #define ZAP_MAXNAMELEN 256 |
80 | #define ZAP_MAXVALUELEN (1024 * 8) | |
81 | #define ZAP_OLDMAXVALUELEN 1024 | |
eca7b760 | 82 | #define ZFS_MAX_DATASET_NAME_LEN 256 |
9babb374 | 83 | |
34dc7c2f BB |
84 | /* |
85 | * Dataset properties are identified by these constants and must be added to | |
86 | * the end of this list to ensure that external consumers are not affected | |
87 | * by the change. If you make any changes to this list, be sure to update | |
e77aa730 | 88 | * the property table in module/zcommon/zfs_prop.c. |
34dc7c2f BB |
89 | */ |
90 | typedef enum { | |
648a09ad BB |
91 | ZFS_PROP_BAD = -1, |
92 | ZFS_PROP_TYPE = 0, | |
34dc7c2f BB |
93 | ZFS_PROP_CREATION, |
94 | ZFS_PROP_USED, | |
95 | ZFS_PROP_AVAILABLE, | |
96 | ZFS_PROP_REFERENCED, | |
97 | ZFS_PROP_COMPRESSRATIO, | |
98 | ZFS_PROP_MOUNTED, | |
99 | ZFS_PROP_ORIGIN, | |
100 | ZFS_PROP_QUOTA, | |
101 | ZFS_PROP_RESERVATION, | |
102 | ZFS_PROP_VOLSIZE, | |
103 | ZFS_PROP_VOLBLOCKSIZE, | |
104 | ZFS_PROP_RECORDSIZE, | |
105 | ZFS_PROP_MOUNTPOINT, | |
106 | ZFS_PROP_SHARENFS, | |
107 | ZFS_PROP_CHECKSUM, | |
108 | ZFS_PROP_COMPRESSION, | |
109 | ZFS_PROP_ATIME, | |
110 | ZFS_PROP_DEVICES, | |
111 | ZFS_PROP_EXEC, | |
112 | ZFS_PROP_SETUID, | |
113 | ZFS_PROP_READONLY, | |
114 | ZFS_PROP_ZONED, | |
115 | ZFS_PROP_SNAPDIR, | |
428870ff | 116 | ZFS_PROP_PRIVATE, /* not exposed to user, temporary */ |
34dc7c2f | 117 | ZFS_PROP_ACLINHERIT, |
305bc4b3 | 118 | ZFS_PROP_CREATETXG, |
34dc7c2f BB |
119 | ZFS_PROP_NAME, /* not exposed to the user */ |
120 | ZFS_PROP_CANMOUNT, | |
34dc7c2f BB |
121 | ZFS_PROP_ISCSIOPTIONS, /* not exposed to the user */ |
122 | ZFS_PROP_XATTR, | |
123 | ZFS_PROP_NUMCLONES, /* not exposed to the user */ | |
124 | ZFS_PROP_COPIES, | |
125 | ZFS_PROP_VERSION, | |
126 | ZFS_PROP_UTF8ONLY, | |
127 | ZFS_PROP_NORMALIZE, | |
128 | ZFS_PROP_CASE, | |
129 | ZFS_PROP_VSCAN, | |
130 | ZFS_PROP_NBMAND, | |
131 | ZFS_PROP_SHARESMB, | |
132 | ZFS_PROP_REFQUOTA, | |
133 | ZFS_PROP_REFRESERVATION, | |
b128c09f BB |
134 | ZFS_PROP_GUID, |
135 | ZFS_PROP_PRIMARYCACHE, | |
136 | ZFS_PROP_SECONDARYCACHE, | |
137 | ZFS_PROP_USEDSNAP, | |
138 | ZFS_PROP_USEDDS, | |
139 | ZFS_PROP_USEDCHILD, | |
140 | ZFS_PROP_USEDREFRESERV, | |
9babb374 BB |
141 | ZFS_PROP_USERACCOUNTING, /* not exposed to the user */ |
142 | ZFS_PROP_STMF_SHAREINFO, /* not exposed to the user */ | |
45d1cae3 BB |
143 | ZFS_PROP_DEFER_DESTROY, |
144 | ZFS_PROP_USERREFS, | |
428870ff BB |
145 | ZFS_PROP_LOGBIAS, |
146 | ZFS_PROP_UNIQUE, /* not exposed to the user */ | |
147 | ZFS_PROP_OBJSETID, /* not exposed to the user */ | |
148 | ZFS_PROP_DEDUP, | |
149 | ZFS_PROP_MLSLABEL, | |
150 | ZFS_PROP_SYNC, | |
50c957f7 | 151 | ZFS_PROP_DNODESIZE, |
f5fc4aca | 152 | ZFS_PROP_REFRATIO, |
330d06f9 MA |
153 | ZFS_PROP_WRITTEN, |
154 | ZFS_PROP_CLONES, | |
24a64651 MA |
155 | ZFS_PROP_LOGICALUSED, |
156 | ZFS_PROP_LOGICALREFERENCED, | |
96c2e961 | 157 | ZFS_PROP_INCONSISTENT, /* not exposed to the user */ |
cf8738d8 | 158 | ZFS_PROP_VOLMODE, |
788eb90c JJ |
159 | ZFS_PROP_FILESYSTEM_LIMIT, |
160 | ZFS_PROP_SNAPSHOT_LIMIT, | |
161 | ZFS_PROP_FILESYSTEM_COUNT, | |
162 | ZFS_PROP_SNAPSHOT_COUNT, | |
0b4d1b58 | 163 | ZFS_PROP_SNAPDEV, |
023699cd | 164 | ZFS_PROP_ACLTYPE, |
11b9ec23 MT |
165 | ZFS_PROP_SELINUX_CONTEXT, |
166 | ZFS_PROP_SELINUX_FSCONTEXT, | |
167 | ZFS_PROP_SELINUX_DEFCONTEXT, | |
168 | ZFS_PROP_SELINUX_ROOTCONTEXT, | |
6d111134 | 169 | ZFS_PROP_RELATIME, |
faf0f58c | 170 | ZFS_PROP_REDUNDANT_METADATA, |
f67d7090 | 171 | ZFS_PROP_OVERLAY, |
1715493f | 172 | ZFS_PROP_PREV_SNAP, |
47dfff3b | 173 | ZFS_PROP_RECEIVE_RESUME_TOKEN, |
34dc7c2f BB |
174 | ZFS_NUM_PROPS |
175 | } zfs_prop_t; | |
176 | ||
9babb374 BB |
177 | typedef enum { |
178 | ZFS_PROP_USERUSED, | |
179 | ZFS_PROP_USERQUOTA, | |
180 | ZFS_PROP_GROUPUSED, | |
181 | ZFS_PROP_GROUPQUOTA, | |
1de321e6 JX |
182 | ZFS_PROP_USEROBJUSED, |
183 | ZFS_PROP_USEROBJQUOTA, | |
184 | ZFS_PROP_GROUPOBJUSED, | |
185 | ZFS_PROP_GROUPOBJQUOTA, | |
9babb374 BB |
186 | ZFS_NUM_USERQUOTA_PROPS |
187 | } zfs_userquota_prop_t; | |
188 | ||
189 | extern const char *zfs_userquota_prop_prefixes[ZFS_NUM_USERQUOTA_PROPS]; | |
190 | ||
34dc7c2f BB |
191 | /* |
192 | * Pool properties are identified by these constants and must be added to the | |
b128c09f | 193 | * end of this list to ensure that external consumers are not affected |
34dc7c2f | 194 | * by the change. If you make any changes to this list, be sure to update |
e77aa730 | 195 | * the property table in module/zcommon/zpool_prop.c. |
34dc7c2f BB |
196 | */ |
197 | typedef enum { | |
198 | ZPOOL_PROP_NAME, | |
199 | ZPOOL_PROP_SIZE, | |
34dc7c2f BB |
200 | ZPOOL_PROP_CAPACITY, |
201 | ZPOOL_PROP_ALTROOT, | |
202 | ZPOOL_PROP_HEALTH, | |
203 | ZPOOL_PROP_GUID, | |
204 | ZPOOL_PROP_VERSION, | |
205 | ZPOOL_PROP_BOOTFS, | |
206 | ZPOOL_PROP_DELEGATION, | |
207 | ZPOOL_PROP_AUTOREPLACE, | |
208 | ZPOOL_PROP_CACHEFILE, | |
209 | ZPOOL_PROP_FAILUREMODE, | |
b128c09f | 210 | ZPOOL_PROP_LISTSNAPS, |
9babb374 | 211 | ZPOOL_PROP_AUTOEXPAND, |
428870ff BB |
212 | ZPOOL_PROP_DEDUPDITTO, |
213 | ZPOOL_PROP_DEDUPRATIO, | |
214 | ZPOOL_PROP_FREE, | |
215 | ZPOOL_PROP_ALLOCATED, | |
572e2857 | 216 | ZPOOL_PROP_READONLY, |
df30f566 | 217 | ZPOOL_PROP_ASHIFT, |
d96eb2b1 | 218 | ZPOOL_PROP_COMMENT, |
1bd201e7 | 219 | ZPOOL_PROP_EXPANDSZ, |
9ae529ec | 220 | ZPOOL_PROP_FREEING, |
f3a7f661 | 221 | ZPOOL_PROP_FRAGMENTATION, |
fbeddd60 | 222 | ZPOOL_PROP_LEAKED, |
f1512ee6 | 223 | ZPOOL_PROP_MAXBLOCKSIZE, |
83e9986f | 224 | ZPOOL_PROP_TNAME, |
50c957f7 | 225 | ZPOOL_PROP_MAXDNODESIZE, |
34dc7c2f BB |
226 | ZPOOL_NUM_PROPS |
227 | } zpool_prop_t; | |
228 | ||
d96eb2b1 DM |
229 | /* Small enough to not hog a whole line of printout in zpool(1M). */ |
230 | #define ZPROP_MAX_COMMENT 32 | |
231 | ||
34dc7c2f BB |
232 | #define ZPROP_CONT -2 |
233 | #define ZPROP_INVAL -1 | |
234 | ||
235 | #define ZPROP_VALUE "value" | |
236 | #define ZPROP_SOURCE "source" | |
237 | ||
238 | typedef enum { | |
239 | ZPROP_SRC_NONE = 0x1, | |
240 | ZPROP_SRC_DEFAULT = 0x2, | |
241 | ZPROP_SRC_TEMPORARY = 0x4, | |
242 | ZPROP_SRC_LOCAL = 0x8, | |
428870ff BB |
243 | ZPROP_SRC_INHERITED = 0x10, |
244 | ZPROP_SRC_RECEIVED = 0x20 | |
34dc7c2f BB |
245 | } zprop_source_t; |
246 | ||
428870ff BB |
247 | #define ZPROP_SRC_ALL 0x3f |
248 | ||
249 | #define ZPROP_SOURCE_VAL_RECVD "$recvd" | |
250 | #define ZPROP_N_MORE_ERRORS "N_MORE_ERRORS" | |
43e52edd | 251 | |
428870ff BB |
252 | /* |
253 | * Dataset flag implemented as a special entry in the props zap object | |
254 | * indicating that the dataset has received properties on or after | |
255 | * SPA_VERSION_RECVD_PROPS. The first such receive blows away local properties | |
256 | * just as it did in earlier versions, and thereafter, local properties are | |
257 | * preserved. | |
258 | */ | |
259 | #define ZPROP_HAS_RECVD "$hasrecvd" | |
260 | ||
261 | typedef enum { | |
262 | ZPROP_ERR_NOCLEAR = 0x1, /* failure to clear existing props */ | |
263 | ZPROP_ERR_NORESTORE = 0x2 /* failure to restore props on error */ | |
264 | } zprop_errflags_t; | |
34dc7c2f BB |
265 | |
266 | typedef int (*zprop_func)(int, void *); | |
267 | ||
b128c09f BB |
268 | /* |
269 | * Properties to be set on the root file system of a new pool | |
270 | * are stuffed into their own nvlist, which is then included in | |
271 | * the properties nvlist with the pool properties. | |
272 | */ | |
273 | #define ZPOOL_ROOTFS_PROPS "root-props-nvl" | |
274 | ||
34dc7c2f BB |
275 | /* |
276 | * Dataset property functions shared between libzfs and kernel. | |
277 | */ | |
278 | const char *zfs_prop_default_string(zfs_prop_t); | |
279 | uint64_t zfs_prop_default_numeric(zfs_prop_t); | |
280 | boolean_t zfs_prop_readonly(zfs_prop_t); | |
281 | boolean_t zfs_prop_inheritable(zfs_prop_t); | |
282 | boolean_t zfs_prop_setonce(zfs_prop_t); | |
283 | const char *zfs_prop_to_name(zfs_prop_t); | |
284 | zfs_prop_t zfs_name_to_prop(const char *); | |
285 | boolean_t zfs_prop_user(const char *); | |
428870ff | 286 | boolean_t zfs_prop_userquota(const char *); |
330d06f9 | 287 | boolean_t zfs_prop_written(const char *); |
34dc7c2f BB |
288 | int zfs_prop_index_to_string(zfs_prop_t, uint64_t, const char **); |
289 | int zfs_prop_string_to_index(zfs_prop_t, const char *, uint64_t *); | |
428870ff | 290 | uint64_t zfs_prop_random_value(zfs_prop_t, uint64_t seed); |
962d5242 | 291 | boolean_t zfs_prop_valid_for_type(int, zfs_type_t, boolean_t); |
34dc7c2f BB |
292 | |
293 | /* | |
294 | * Pool property functions shared between libzfs and kernel. | |
295 | */ | |
296 | zpool_prop_t zpool_name_to_prop(const char *); | |
297 | const char *zpool_prop_to_name(zpool_prop_t); | |
298 | const char *zpool_prop_default_string(zpool_prop_t); | |
299 | uint64_t zpool_prop_default_numeric(zpool_prop_t); | |
300 | boolean_t zpool_prop_readonly(zpool_prop_t); | |
9ae529ec CS |
301 | boolean_t zpool_prop_feature(const char *); |
302 | boolean_t zpool_prop_unsupported(const char *); | |
34dc7c2f BB |
303 | int zpool_prop_index_to_string(zpool_prop_t, uint64_t, const char **); |
304 | int zpool_prop_string_to_index(zpool_prop_t, const char *, uint64_t *); | |
428870ff | 305 | uint64_t zpool_prop_random_value(zpool_prop_t, uint64_t seed); |
34dc7c2f BB |
306 | |
307 | /* | |
308 | * Definitions for the Delegation. | |
309 | */ | |
310 | typedef enum { | |
311 | ZFS_DELEG_WHO_UNKNOWN = 0, | |
312 | ZFS_DELEG_USER = 'u', | |
313 | ZFS_DELEG_USER_SETS = 'U', | |
314 | ZFS_DELEG_GROUP = 'g', | |
315 | ZFS_DELEG_GROUP_SETS = 'G', | |
316 | ZFS_DELEG_EVERYONE = 'e', | |
317 | ZFS_DELEG_EVERYONE_SETS = 'E', | |
318 | ZFS_DELEG_CREATE = 'c', | |
319 | ZFS_DELEG_CREATE_SETS = 'C', | |
320 | ZFS_DELEG_NAMED_SET = 's', | |
321 | ZFS_DELEG_NAMED_SET_SETS = 'S' | |
322 | } zfs_deleg_who_type_t; | |
323 | ||
324 | typedef enum { | |
325 | ZFS_DELEG_NONE = 0, | |
326 | ZFS_DELEG_PERM_LOCAL = 1, | |
327 | ZFS_DELEG_PERM_DESCENDENT = 2, | |
328 | ZFS_DELEG_PERM_LOCALDESCENDENT = 3, | |
329 | ZFS_DELEG_PERM_CREATE = 4 | |
330 | } zfs_deleg_inherit_t; | |
331 | ||
332 | #define ZFS_DELEG_PERM_UID "uid" | |
333 | #define ZFS_DELEG_PERM_GID "gid" | |
334 | #define ZFS_DELEG_PERM_GROUPS "groups" | |
335 | ||
428870ff BB |
336 | #define ZFS_MLSLABEL_DEFAULT "none" |
337 | ||
9babb374 BB |
338 | #define ZFS_SMB_ACL_SRC "src" |
339 | #define ZFS_SMB_ACL_TARGET "target" | |
340 | ||
34dc7c2f BB |
341 | typedef enum { |
342 | ZFS_CANMOUNT_OFF = 0, | |
343 | ZFS_CANMOUNT_ON = 1, | |
344 | ZFS_CANMOUNT_NOAUTO = 2 | |
345 | } zfs_canmount_type_t; | |
346 | ||
428870ff BB |
347 | typedef enum { |
348 | ZFS_LOGBIAS_LATENCY = 0, | |
349 | ZFS_LOGBIAS_THROUGHPUT = 1 | |
350 | } zfs_logbias_op_t; | |
351 | ||
34dc7c2f BB |
352 | typedef enum zfs_share_op { |
353 | ZFS_SHARE_NFS = 0, | |
354 | ZFS_UNSHARE_NFS = 1, | |
355 | ZFS_SHARE_SMB = 2, | |
356 | ZFS_UNSHARE_SMB = 3 | |
357 | } zfs_share_op_t; | |
358 | ||
9babb374 BB |
359 | typedef enum zfs_smb_acl_op { |
360 | ZFS_SMB_ACL_ADD, | |
361 | ZFS_SMB_ACL_REMOVE, | |
362 | ZFS_SMB_ACL_RENAME, | |
363 | ZFS_SMB_ACL_PURGE | |
364 | } zfs_smb_acl_op_t; | |
365 | ||
b128c09f BB |
366 | typedef enum zfs_cache_type { |
367 | ZFS_CACHE_NONE = 0, | |
368 | ZFS_CACHE_METADATA = 1, | |
369 | ZFS_CACHE_ALL = 2 | |
370 | } zfs_cache_type_t; | |
371 | ||
428870ff BB |
372 | typedef enum { |
373 | ZFS_SYNC_STANDARD = 0, | |
374 | ZFS_SYNC_ALWAYS = 1, | |
375 | ZFS_SYNC_DISABLED = 2 | |
376 | } zfs_sync_type_t; | |
377 | ||
82a37189 BB |
378 | typedef enum { |
379 | ZFS_XATTR_OFF = 0, | |
380 | ZFS_XATTR_DIR = 1, | |
381 | ZFS_XATTR_SA = 2 | |
382 | } zfs_xattr_type_t; | |
b128c09f | 383 | |
50c957f7 NB |
384 | typedef enum { |
385 | ZFS_DNSIZE_LEGACY = 0, | |
386 | ZFS_DNSIZE_AUTO = 1, | |
387 | ZFS_DNSIZE_1K = 1024, | |
388 | ZFS_DNSIZE_2K = 2048, | |
389 | ZFS_DNSIZE_4K = 4096, | |
390 | ZFS_DNSIZE_8K = 8192, | |
391 | ZFS_DNSIZE_16K = 16384 | |
392 | } zfs_dnsize_type_t; | |
393 | ||
faf0f58c MA |
394 | typedef enum { |
395 | ZFS_REDUNDANT_METADATA_ALL, | |
396 | ZFS_REDUNDANT_METADATA_MOST | |
397 | } zfs_redundant_metadata_type_t; | |
398 | ||
cf8738d8 | 399 | typedef enum { |
400 | ZFS_VOLMODE_DEFAULT = 0, | |
401 | ZFS_VOLMODE_GEOM = 1, | |
402 | ZFS_VOLMODE_DEV = 2, | |
403 | ZFS_VOLMODE_NONE = 3 | |
404 | } zfs_volmode_t; | |
405 | ||
34dc7c2f BB |
406 | /* |
407 | * On-disk version number. | |
408 | */ | |
409 | #define SPA_VERSION_1 1ULL | |
410 | #define SPA_VERSION_2 2ULL | |
411 | #define SPA_VERSION_3 3ULL | |
412 | #define SPA_VERSION_4 4ULL | |
413 | #define SPA_VERSION_5 5ULL | |
414 | #define SPA_VERSION_6 6ULL | |
415 | #define SPA_VERSION_7 7ULL | |
416 | #define SPA_VERSION_8 8ULL | |
417 | #define SPA_VERSION_9 9ULL | |
418 | #define SPA_VERSION_10 10ULL | |
b128c09f BB |
419 | #define SPA_VERSION_11 11ULL |
420 | #define SPA_VERSION_12 12ULL | |
421 | #define SPA_VERSION_13 13ULL | |
422 | #define SPA_VERSION_14 14ULL | |
9babb374 BB |
423 | #define SPA_VERSION_15 15ULL |
424 | #define SPA_VERSION_16 16ULL | |
45d1cae3 BB |
425 | #define SPA_VERSION_17 17ULL |
426 | #define SPA_VERSION_18 18ULL | |
428870ff BB |
427 | #define SPA_VERSION_19 19ULL |
428 | #define SPA_VERSION_20 20ULL | |
429 | #define SPA_VERSION_21 21ULL | |
430 | #define SPA_VERSION_22 22ULL | |
431 | #define SPA_VERSION_23 23ULL | |
432 | #define SPA_VERSION_24 24ULL | |
433 | #define SPA_VERSION_25 25ULL | |
434 | #define SPA_VERSION_26 26ULL | |
572e2857 BB |
435 | #define SPA_VERSION_27 27ULL |
436 | #define SPA_VERSION_28 28ULL | |
9ae529ec | 437 | #define SPA_VERSION_5000 5000ULL |
572e2857 | 438 | |
34dc7c2f BB |
439 | /* |
440 | * When bumping up SPA_VERSION, make sure GRUB ZFS understands the on-disk | |
9babb374 BB |
441 | * format change. Go to usr/src/grub/grub-0.97/stage2/{zfs-include/, fsys_zfs*}, |
442 | * and do the appropriate changes. Also bump the version number in | |
443 | * usr/src/grub/capability. | |
34dc7c2f | 444 | */ |
9ae529ec CS |
445 | #define SPA_VERSION SPA_VERSION_5000 |
446 | #define SPA_VERSION_STRING "5000" | |
34dc7c2f BB |
447 | |
448 | /* | |
449 | * Symbolic names for the changes that caused a SPA_VERSION switch. | |
450 | * Used in the code when checking for presence or absence of a feature. | |
451 | * Feel free to define multiple symbolic names for each version if there | |
452 | * were multiple changes to on-disk structures during that version. | |
453 | * | |
454 | * NOTE: When checking the current SPA_VERSION in your code, be sure | |
455 | * to use spa_version() since it reports the version of the | |
456 | * last synced uberblock. Checking the in-flight version can | |
457 | * be dangerous in some cases. | |
458 | */ | |
459 | #define SPA_VERSION_INITIAL SPA_VERSION_1 | |
460 | #define SPA_VERSION_DITTO_BLOCKS SPA_VERSION_2 | |
461 | #define SPA_VERSION_SPARES SPA_VERSION_3 | |
45d1cae3 | 462 | #define SPA_VERSION_RAIDZ2 SPA_VERSION_3 |
428870ff | 463 | #define SPA_VERSION_BPOBJ_ACCOUNT SPA_VERSION_3 |
34dc7c2f BB |
464 | #define SPA_VERSION_RAIDZ_DEFLATE SPA_VERSION_3 |
465 | #define SPA_VERSION_DNODE_BYTES SPA_VERSION_3 | |
466 | #define SPA_VERSION_ZPOOL_HISTORY SPA_VERSION_4 | |
467 | #define SPA_VERSION_GZIP_COMPRESSION SPA_VERSION_5 | |
468 | #define SPA_VERSION_BOOTFS SPA_VERSION_6 | |
469 | #define SPA_VERSION_SLOGS SPA_VERSION_7 | |
470 | #define SPA_VERSION_DELEGATED_PERMS SPA_VERSION_8 | |
471 | #define SPA_VERSION_FUID SPA_VERSION_9 | |
472 | #define SPA_VERSION_REFRESERVATION SPA_VERSION_9 | |
473 | #define SPA_VERSION_REFQUOTA SPA_VERSION_9 | |
474 | #define SPA_VERSION_UNIQUE_ACCURATE SPA_VERSION_9 | |
475 | #define SPA_VERSION_L2CACHE SPA_VERSION_10 | |
b128c09f BB |
476 | #define SPA_VERSION_NEXT_CLONES SPA_VERSION_11 |
477 | #define SPA_VERSION_ORIGIN SPA_VERSION_11 | |
478 | #define SPA_VERSION_DSL_SCRUB SPA_VERSION_11 | |
479 | #define SPA_VERSION_SNAP_PROPS SPA_VERSION_12 | |
480 | #define SPA_VERSION_USED_BREAKDOWN SPA_VERSION_13 | |
481 | #define SPA_VERSION_PASSTHROUGH_X SPA_VERSION_14 | |
9babb374 BB |
482 | #define SPA_VERSION_USERSPACE SPA_VERSION_15 |
483 | #define SPA_VERSION_STMF_PROP SPA_VERSION_16 | |
45d1cae3 BB |
484 | #define SPA_VERSION_RAIDZ3 SPA_VERSION_17 |
485 | #define SPA_VERSION_USERREFS SPA_VERSION_18 | |
428870ff BB |
486 | #define SPA_VERSION_HOLES SPA_VERSION_19 |
487 | #define SPA_VERSION_ZLE_COMPRESSION SPA_VERSION_20 | |
488 | #define SPA_VERSION_DEDUP SPA_VERSION_21 | |
489 | #define SPA_VERSION_RECVD_PROPS SPA_VERSION_22 | |
490 | #define SPA_VERSION_SLIM_ZIL SPA_VERSION_23 | |
491 | #define SPA_VERSION_SA SPA_VERSION_24 | |
492 | #define SPA_VERSION_SCAN SPA_VERSION_25 | |
493 | #define SPA_VERSION_DIR_CLONES SPA_VERSION_26 | |
494 | #define SPA_VERSION_DEADLISTS SPA_VERSION_26 | |
572e2857 BB |
495 | #define SPA_VERSION_FAST_SNAP SPA_VERSION_27 |
496 | #define SPA_VERSION_MULTI_REPLACE SPA_VERSION_28 | |
9ae529ec CS |
497 | #define SPA_VERSION_BEFORE_FEATURES SPA_VERSION_28 |
498 | #define SPA_VERSION_FEATURES SPA_VERSION_5000 | |
499 | ||
500 | #define SPA_VERSION_IS_SUPPORTED(v) \ | |
501 | (((v) >= SPA_VERSION_INITIAL && (v) <= SPA_VERSION_BEFORE_FEATURES) || \ | |
502 | ((v) >= SPA_VERSION_FEATURES && (v) <= SPA_VERSION)) | |
34dc7c2f BB |
503 | |
504 | /* | |
505 | * ZPL version - rev'd whenever an incompatible on-disk format change | |
506 | * occurs. This is independent of SPA/DMU/ZAP versioning. You must | |
507 | * also update the version_table[] and help message in zfs_prop.c. | |
508 | * | |
509 | * When changing, be sure to teach GRUB how to read the new format! | |
9babb374 | 510 | * See usr/src/grub/grub-0.97/stage2/{zfs-include/,fsys_zfs*} |
34dc7c2f BB |
511 | */ |
512 | #define ZPL_VERSION_1 1ULL | |
513 | #define ZPL_VERSION_2 2ULL | |
514 | #define ZPL_VERSION_3 3ULL | |
9babb374 | 515 | #define ZPL_VERSION_4 4ULL |
428870ff BB |
516 | #define ZPL_VERSION_5 5ULL |
517 | #define ZPL_VERSION ZPL_VERSION_5 | |
518 | #define ZPL_VERSION_STRING "5" | |
34dc7c2f BB |
519 | |
520 | #define ZPL_VERSION_INITIAL ZPL_VERSION_1 | |
521 | #define ZPL_VERSION_DIRENT_TYPE ZPL_VERSION_2 | |
522 | #define ZPL_VERSION_FUID ZPL_VERSION_3 | |
523 | #define ZPL_VERSION_NORMALIZATION ZPL_VERSION_3 | |
524 | #define ZPL_VERSION_SYSATTR ZPL_VERSION_3 | |
9babb374 | 525 | #define ZPL_VERSION_USERSPACE ZPL_VERSION_4 |
428870ff BB |
526 | #define ZPL_VERSION_SA ZPL_VERSION_5 |
527 | ||
528 | /* Rewind request information */ | |
529 | #define ZPOOL_NO_REWIND 1 /* No policy - default behavior */ | |
530 | #define ZPOOL_NEVER_REWIND 2 /* Do not search for best txg or rewind */ | |
531 | #define ZPOOL_TRY_REWIND 4 /* Search for best txg, but do not rewind */ | |
532 | #define ZPOOL_DO_REWIND 8 /* Rewind to best txg w/in deferred frees */ | |
533 | #define ZPOOL_EXTREME_REWIND 16 /* Allow extreme measures to find best txg */ | |
534 | #define ZPOOL_REWIND_MASK 28 /* All the possible rewind bits */ | |
535 | #define ZPOOL_REWIND_POLICIES 31 /* All the possible policy bits */ | |
536 | ||
537 | typedef struct zpool_rewind_policy { | |
538 | uint32_t zrp_request; /* rewind behavior requested */ | |
539 | uint64_t zrp_maxmeta; /* max acceptable meta-data errors */ | |
540 | uint64_t zrp_maxdata; /* max acceptable data errors */ | |
541 | uint64_t zrp_txg; /* specific txg to load */ | |
542 | } zpool_rewind_policy_t; | |
34dc7c2f BB |
543 | |
544 | /* | |
545 | * The following are configuration names used in the nvlist describing a pool's | |
546 | * configuration. | |
547 | */ | |
548 | #define ZPOOL_CONFIG_VERSION "version" | |
549 | #define ZPOOL_CONFIG_POOL_NAME "name" | |
550 | #define ZPOOL_CONFIG_POOL_STATE "state" | |
551 | #define ZPOOL_CONFIG_POOL_TXG "txg" | |
552 | #define ZPOOL_CONFIG_POOL_GUID "pool_guid" | |
553 | #define ZPOOL_CONFIG_CREATE_TXG "create_txg" | |
554 | #define ZPOOL_CONFIG_TOP_GUID "top_guid" | |
555 | #define ZPOOL_CONFIG_VDEV_TREE "vdev_tree" | |
556 | #define ZPOOL_CONFIG_TYPE "type" | |
557 | #define ZPOOL_CONFIG_CHILDREN "children" | |
558 | #define ZPOOL_CONFIG_ID "id" | |
559 | #define ZPOOL_CONFIG_GUID "guid" | |
560 | #define ZPOOL_CONFIG_PATH "path" | |
561 | #define ZPOOL_CONFIG_DEVID "devid" | |
562 | #define ZPOOL_CONFIG_METASLAB_ARRAY "metaslab_array" | |
563 | #define ZPOOL_CONFIG_METASLAB_SHIFT "metaslab_shift" | |
564 | #define ZPOOL_CONFIG_ASHIFT "ashift" | |
565 | #define ZPOOL_CONFIG_ASIZE "asize" | |
566 | #define ZPOOL_CONFIG_DTL "DTL" | |
428870ff BB |
567 | #define ZPOOL_CONFIG_SCAN_STATS "scan_stats" /* not stored on disk */ |
568 | #define ZPOOL_CONFIG_VDEV_STATS "vdev_stats" /* not stored on disk */ | |
193a37cb TH |
569 | |
570 | /* container nvlist of extended stats */ | |
571 | #define ZPOOL_CONFIG_VDEV_STATS_EX "vdev_stats_ex" | |
572 | ||
573 | /* Active queue read/write stats */ | |
574 | #define ZPOOL_CONFIG_VDEV_SYNC_R_ACTIVE_QUEUE "vdev_sync_r_active_queue" | |
575 | #define ZPOOL_CONFIG_VDEV_SYNC_W_ACTIVE_QUEUE "vdev_sync_w_active_queue" | |
576 | #define ZPOOL_CONFIG_VDEV_ASYNC_R_ACTIVE_QUEUE "vdev_async_r_active_queue" | |
577 | #define ZPOOL_CONFIG_VDEV_ASYNC_W_ACTIVE_QUEUE "vdev_async_w_active_queue" | |
578 | #define ZPOOL_CONFIG_VDEV_SCRUB_ACTIVE_QUEUE "vdev_async_scrub_active_queue" | |
579 | ||
580 | /* Queue sizes */ | |
581 | #define ZPOOL_CONFIG_VDEV_SYNC_R_PEND_QUEUE "vdev_sync_r_pend_queue" | |
582 | #define ZPOOL_CONFIG_VDEV_SYNC_W_PEND_QUEUE "vdev_sync_w_pend_queue" | |
583 | #define ZPOOL_CONFIG_VDEV_ASYNC_R_PEND_QUEUE "vdev_async_r_pend_queue" | |
584 | #define ZPOOL_CONFIG_VDEV_ASYNC_W_PEND_QUEUE "vdev_async_w_pend_queue" | |
585 | #define ZPOOL_CONFIG_VDEV_SCRUB_PEND_QUEUE "vdev_async_scrub_pend_queue" | |
586 | ||
587 | /* Latency read/write histogram stats */ | |
588 | #define ZPOOL_CONFIG_VDEV_TOT_R_LAT_HISTO "vdev_tot_r_lat_histo" | |
589 | #define ZPOOL_CONFIG_VDEV_TOT_W_LAT_HISTO "vdev_tot_w_lat_histo" | |
590 | #define ZPOOL_CONFIG_VDEV_DISK_R_LAT_HISTO "vdev_disk_r_lat_histo" | |
591 | #define ZPOOL_CONFIG_VDEV_DISK_W_LAT_HISTO "vdev_disk_w_lat_histo" | |
592 | #define ZPOOL_CONFIG_VDEV_SYNC_R_LAT_HISTO "vdev_sync_r_lat_histo" | |
593 | #define ZPOOL_CONFIG_VDEV_SYNC_W_LAT_HISTO "vdev_sync_w_lat_histo" | |
594 | #define ZPOOL_CONFIG_VDEV_ASYNC_R_LAT_HISTO "vdev_async_r_lat_histo" | |
595 | #define ZPOOL_CONFIG_VDEV_ASYNC_W_LAT_HISTO "vdev_async_w_lat_histo" | |
596 | #define ZPOOL_CONFIG_VDEV_SCRUB_LAT_HISTO "vdev_scrub_histo" | |
597 | ||
7e945072 TH |
598 | /* Request size histograms */ |
599 | #define ZPOOL_CONFIG_VDEV_SYNC_IND_R_HISTO "vdev_sync_ind_r_histo" | |
600 | #define ZPOOL_CONFIG_VDEV_SYNC_IND_W_HISTO "vdev_sync_ind_w_histo" | |
601 | #define ZPOOL_CONFIG_VDEV_ASYNC_IND_R_HISTO "vdev_async_ind_r_histo" | |
602 | #define ZPOOL_CONFIG_VDEV_ASYNC_IND_W_HISTO "vdev_async_ind_w_histo" | |
603 | #define ZPOOL_CONFIG_VDEV_IND_SCRUB_HISTO "vdev_ind_scrub_histo" | |
604 | #define ZPOOL_CONFIG_VDEV_SYNC_AGG_R_HISTO "vdev_sync_agg_r_histo" | |
605 | #define ZPOOL_CONFIG_VDEV_SYNC_AGG_W_HISTO "vdev_sync_agg_w_histo" | |
606 | #define ZPOOL_CONFIG_VDEV_ASYNC_AGG_R_HISTO "vdev_async_agg_r_histo" | |
607 | #define ZPOOL_CONFIG_VDEV_ASYNC_AGG_W_HISTO "vdev_async_agg_w_histo" | |
608 | #define ZPOOL_CONFIG_VDEV_AGG_SCRUB_HISTO "vdev_agg_scrub_histo" | |
193a37cb | 609 | |
1bbd8770 TH |
610 | /* vdev enclosure sysfs path */ |
611 | #define ZPOOL_CONFIG_VDEV_ENC_SYSFS_PATH "vdev_enc_sysfs_path" | |
612 | ||
34dc7c2f BB |
613 | #define ZPOOL_CONFIG_WHOLE_DISK "whole_disk" |
614 | #define ZPOOL_CONFIG_ERRCOUNT "error_count" | |
615 | #define ZPOOL_CONFIG_NOT_PRESENT "not_present" | |
616 | #define ZPOOL_CONFIG_SPARES "spares" | |
617 | #define ZPOOL_CONFIG_IS_SPARE "is_spare" | |
618 | #define ZPOOL_CONFIG_NPARITY "nparity" | |
619 | #define ZPOOL_CONFIG_HOSTID "hostid" | |
620 | #define ZPOOL_CONFIG_HOSTNAME "hostname" | |
572e2857 | 621 | #define ZPOOL_CONFIG_LOADED_TIME "initial_load_time" |
34dc7c2f BB |
622 | #define ZPOOL_CONFIG_UNSPARE "unspare" |
623 | #define ZPOOL_CONFIG_PHYS_PATH "phys_path" | |
624 | #define ZPOOL_CONFIG_IS_LOG "is_log" | |
625 | #define ZPOOL_CONFIG_L2CACHE "l2cache" | |
428870ff BB |
626 | #define ZPOOL_CONFIG_HOLE_ARRAY "hole_array" |
627 | #define ZPOOL_CONFIG_VDEV_CHILDREN "vdev_children" | |
628 | #define ZPOOL_CONFIG_IS_HOLE "is_hole" | |
629 | #define ZPOOL_CONFIG_DDT_HISTOGRAM "ddt_histogram" | |
630 | #define ZPOOL_CONFIG_DDT_OBJ_STATS "ddt_object_stats" | |
631 | #define ZPOOL_CONFIG_DDT_STATS "ddt_stats" | |
632 | #define ZPOOL_CONFIG_SPLIT "splitcfg" | |
633 | #define ZPOOL_CONFIG_ORIG_GUID "orig_guid" | |
634 | #define ZPOOL_CONFIG_SPLIT_GUID "split_guid" | |
635 | #define ZPOOL_CONFIG_SPLIT_LIST "guid_list" | |
636 | #define ZPOOL_CONFIG_REMOVING "removing" | |
5d1f7fb6 | 637 | #define ZPOOL_CONFIG_RESILVER_TXG "resilver_txg" |
d96eb2b1 | 638 | #define ZPOOL_CONFIG_COMMENT "comment" |
b128c09f | 639 | #define ZPOOL_CONFIG_SUSPENDED "suspended" /* not stored on disk */ |
34dc7c2f BB |
640 | #define ZPOOL_CONFIG_TIMESTAMP "timestamp" /* not stored on disk */ |
641 | #define ZPOOL_CONFIG_BOOTFS "bootfs" /* not stored on disk */ | |
572e2857 BB |
642 | #define ZPOOL_CONFIG_MISSING_DEVICES "missing_vdevs" /* not stored on disk */ |
643 | #define ZPOOL_CONFIG_LOAD_INFO "load_info" /* not stored on disk */ | |
9ae529ec CS |
644 | #define ZPOOL_CONFIG_REWIND_INFO "rewind_info" /* not stored on disk */ |
645 | #define ZPOOL_CONFIG_UNSUP_FEAT "unsup_feat" /* not stored on disk */ | |
b9b24bb4 | 646 | #define ZPOOL_CONFIG_ENABLED_FEAT "enabled_feat" /* not stored on disk */ |
9ae529ec CS |
647 | #define ZPOOL_CONFIG_CAN_RDONLY "can_rdonly" /* not stored on disk */ |
648 | #define ZPOOL_CONFIG_FEATURES_FOR_READ "features_for_read" | |
649 | #define ZPOOL_CONFIG_FEATURE_STATS "feature_stats" /* not stored on disk */ | |
ffe9d382 | 650 | #define ZPOOL_CONFIG_ERRATA "errata" /* not stored on disk */ |
e0ab3ab5 JS |
651 | #define ZPOOL_CONFIG_VDEV_TOP_ZAP "com.delphix:vdev_zap_top" |
652 | #define ZPOOL_CONFIG_VDEV_LEAF_ZAP "com.delphix:vdev_zap_leaf" | |
653 | #define ZPOOL_CONFIG_HAS_PER_VDEV_ZAPS "com.delphix:has_per_vdev_zaps" | |
34dc7c2f BB |
654 | /* |
655 | * The persistent vdev state is stored as separate values rather than a single | |
656 | * 'vdev_state' entry. This is because a device can be in multiple states, such | |
657 | * as offline and degraded. | |
658 | */ | |
659 | #define ZPOOL_CONFIG_OFFLINE "offline" | |
660 | #define ZPOOL_CONFIG_FAULTED "faulted" | |
661 | #define ZPOOL_CONFIG_DEGRADED "degraded" | |
662 | #define ZPOOL_CONFIG_REMOVED "removed" | |
9babb374 | 663 | #define ZPOOL_CONFIG_FRU "fru" |
428870ff BB |
664 | #define ZPOOL_CONFIG_AUX_STATE "aux_state" |
665 | ||
666 | /* Rewind policy parameters */ | |
667 | #define ZPOOL_REWIND_POLICY "rewind-policy" | |
668 | #define ZPOOL_REWIND_REQUEST "rewind-request" | |
669 | #define ZPOOL_REWIND_REQUEST_TXG "rewind-request-txg" | |
670 | #define ZPOOL_REWIND_META_THRESH "rewind-meta-thresh" | |
671 | #define ZPOOL_REWIND_DATA_THRESH "rewind-data-thresh" | |
672 | ||
673 | /* Rewind data discovered */ | |
674 | #define ZPOOL_CONFIG_LOAD_TIME "rewind_txg_ts" | |
675 | #define ZPOOL_CONFIG_LOAD_DATA_ERRORS "verify_data_errors" | |
676 | #define ZPOOL_CONFIG_REWIND_TIME "seconds_of_rewind" | |
34dc7c2f BB |
677 | |
678 | #define VDEV_TYPE_ROOT "root" | |
679 | #define VDEV_TYPE_MIRROR "mirror" | |
680 | #define VDEV_TYPE_REPLACING "replacing" | |
681 | #define VDEV_TYPE_RAIDZ "raidz" | |
682 | #define VDEV_TYPE_DISK "disk" | |
683 | #define VDEV_TYPE_FILE "file" | |
684 | #define VDEV_TYPE_MISSING "missing" | |
428870ff | 685 | #define VDEV_TYPE_HOLE "hole" |
34dc7c2f BB |
686 | #define VDEV_TYPE_SPARE "spare" |
687 | #define VDEV_TYPE_LOG "log" | |
688 | #define VDEV_TYPE_L2CACHE "l2cache" | |
689 | ||
690 | /* | |
691 | * This is needed in userland to report the minimum necessary device size. | |
692 | */ | |
693 | #define SPA_MINDEVSIZE (64ULL << 20) | |
694 | ||
f3a7f661 GW |
695 | /* |
696 | * Set if the fragmentation has not yet been calculated. This can happen | |
697 | * because the space maps have not been upgraded or the histogram feature | |
698 | * is not enabled. | |
699 | */ | |
700 | #define ZFS_FRAG_INVALID UINT64_MAX | |
701 | ||
34dc7c2f BB |
702 | /* |
703 | * The location of the pool configuration repository, shared between kernel and | |
704 | * userland. | |
705 | */ | |
b128c09f | 706 | #define ZPOOL_CACHE "/etc/zfs/zpool.cache" |
34dc7c2f BB |
707 | |
708 | /* | |
709 | * vdev states are ordered from least to most healthy. | |
710 | * A vdev that's CANT_OPEN or below is considered unusable. | |
711 | */ | |
712 | typedef enum vdev_state { | |
713 | VDEV_STATE_UNKNOWN = 0, /* Uninitialized vdev */ | |
714 | VDEV_STATE_CLOSED, /* Not currently open */ | |
715 | VDEV_STATE_OFFLINE, /* Not allowed to open */ | |
716 | VDEV_STATE_REMOVED, /* Explicitly removed from system */ | |
717 | VDEV_STATE_CANT_OPEN, /* Tried to open, but failed */ | |
718 | VDEV_STATE_FAULTED, /* External request to fault device */ | |
719 | VDEV_STATE_DEGRADED, /* Replicated vdev with unhealthy kids */ | |
720 | VDEV_STATE_HEALTHY /* Presumed good */ | |
721 | } vdev_state_t; | |
722 | ||
723 | #define VDEV_STATE_ONLINE VDEV_STATE_HEALTHY | |
724 | ||
725 | /* | |
726 | * vdev aux states. When a vdev is in the CANT_OPEN state, the aux field | |
727 | * of the vdev stats structure uses these constants to distinguish why. | |
728 | */ | |
729 | typedef enum vdev_aux { | |
730 | VDEV_AUX_NONE, /* no error */ | |
731 | VDEV_AUX_OPEN_FAILED, /* ldi_open_*() or vn_open() failed */ | |
732 | VDEV_AUX_CORRUPT_DATA, /* bad label or disk contents */ | |
733 | VDEV_AUX_NO_REPLICAS, /* insufficient number of replicas */ | |
734 | VDEV_AUX_BAD_GUID_SUM, /* vdev guid sum doesn't match */ | |
735 | VDEV_AUX_TOO_SMALL, /* vdev size is too small */ | |
736 | VDEV_AUX_BAD_LABEL, /* the label is OK but invalid */ | |
737 | VDEV_AUX_VERSION_NEWER, /* on-disk version is too new */ | |
738 | VDEV_AUX_VERSION_OLDER, /* on-disk version is too old */ | |
9ae529ec | 739 | VDEV_AUX_UNSUP_FEAT, /* unsupported features */ |
34dc7c2f | 740 | VDEV_AUX_SPARED, /* hot spare used in another pool */ |
b128c09f BB |
741 | VDEV_AUX_ERR_EXCEEDED, /* too many errors */ |
742 | VDEV_AUX_IO_FAILURE, /* experienced I/O failure */ | |
428870ff | 743 | VDEV_AUX_BAD_LOG, /* cannot read log chain(s) */ |
4a283c7f | 744 | VDEV_AUX_EXTERNAL, /* external diagnosis or forced fault */ |
ff61d1a4 | 745 | VDEV_AUX_SPLIT_POOL, /* vdev was split off into another pool */ |
4a283c7f TH |
746 | VDEV_AUX_BAD_ASHIFT, /* vdev ashift is invalid */ |
747 | VDEV_AUX_EXTERNAL_PERSIST /* persistent forced fault */ | |
34dc7c2f BB |
748 | } vdev_aux_t; |
749 | ||
750 | /* | |
751 | * pool state. The following states are written to disk as part of the normal | |
752 | * SPA lifecycle: ACTIVE, EXPORTED, DESTROYED, SPARE, L2CACHE. The remaining | |
753 | * states are software abstractions used at various levels to communicate | |
754 | * pool state. | |
755 | */ | |
756 | typedef enum pool_state { | |
757 | POOL_STATE_ACTIVE = 0, /* In active use */ | |
758 | POOL_STATE_EXPORTED, /* Explicitly exported */ | |
759 | POOL_STATE_DESTROYED, /* Explicitly destroyed */ | |
760 | POOL_STATE_SPARE, /* Reserved for hot spare use */ | |
761 | POOL_STATE_L2CACHE, /* Level 2 ARC device */ | |
762 | POOL_STATE_UNINITIALIZED, /* Internal spa_t state */ | |
34dc7c2f BB |
763 | POOL_STATE_UNAVAIL, /* Internal libzfs state */ |
764 | POOL_STATE_POTENTIALLY_ACTIVE /* Internal libzfs state */ | |
765 | } pool_state_t; | |
766 | ||
767 | /* | |
428870ff | 768 | * Scan Functions. |
34dc7c2f | 769 | */ |
428870ff BB |
770 | typedef enum pool_scan_func { |
771 | POOL_SCAN_NONE, | |
772 | POOL_SCAN_SCRUB, | |
773 | POOL_SCAN_RESILVER, | |
774 | POOL_SCAN_FUNCS | |
775 | } pool_scan_func_t; | |
34dc7c2f | 776 | |
0ea05c64 AP |
777 | /* |
778 | * Used to control scrub pause and resume. | |
779 | */ | |
780 | typedef enum pool_scrub_cmd { | |
781 | POOL_SCRUB_NORMAL = 0, | |
782 | POOL_SCRUB_PAUSE, | |
783 | POOL_SCRUB_FLAGS_END | |
784 | } pool_scrub_cmd_t; | |
785 | ||
786 | ||
34dc7c2f BB |
787 | /* |
788 | * ZIO types. Needed to interpret vdev statistics below. | |
789 | */ | |
790 | typedef enum zio_type { | |
791 | ZIO_TYPE_NULL = 0, | |
792 | ZIO_TYPE_READ, | |
793 | ZIO_TYPE_WRITE, | |
794 | ZIO_TYPE_FREE, | |
795 | ZIO_TYPE_CLAIM, | |
796 | ZIO_TYPE_IOCTL, | |
797 | ZIO_TYPES | |
798 | } zio_type_t; | |
799 | ||
428870ff BB |
800 | /* |
801 | * Pool statistics. Note: all fields should be 64-bit because this | |
802 | * is passed between kernel and userland as an nvlist uint64 array. | |
803 | */ | |
804 | typedef struct pool_scan_stat { | |
805 | /* values stored on disk */ | |
806 | uint64_t pss_func; /* pool_scan_func_t */ | |
807 | uint64_t pss_state; /* dsl_scan_state_t */ | |
808 | uint64_t pss_start_time; /* scan start time */ | |
809 | uint64_t pss_end_time; /* scan end time */ | |
810 | uint64_t pss_to_examine; /* total bytes to scan */ | |
811 | uint64_t pss_examined; /* total examined bytes */ | |
812 | uint64_t pss_to_process; /* total bytes to process */ | |
813 | uint64_t pss_processed; /* total processed bytes */ | |
814 | uint64_t pss_errors; /* scan errors */ | |
815 | ||
816 | /* values not stored on disk */ | |
817 | uint64_t pss_pass_exam; /* examined bytes per scan pass */ | |
818 | uint64_t pss_pass_start; /* start time of a scan pass */ | |
0ea05c64 AP |
819 | uint64_t pss_pass_scrub_pause; /* pause time of a scurb pass */ |
820 | /* cumulative time scrub spent paused, needed for rate calculation */ | |
821 | uint64_t pss_pass_scrub_spent_paused; | |
428870ff BB |
822 | } pool_scan_stat_t; |
823 | ||
824 | typedef enum dsl_scan_state { | |
825 | DSS_NONE, | |
826 | DSS_SCANNING, | |
827 | DSS_FINISHED, | |
828 | DSS_CANCELED, | |
829 | DSS_NUM_STATES | |
830 | } dsl_scan_state_t; | |
831 | ||
ffe9d382 BB |
832 | /* |
833 | * Errata described by http://zfsonlinux.org/msg/ZFS-8000-ER. The ordering | |
834 | * of this enum must be maintained to ensure the errata identifiers map to | |
835 | * the correct documentation. New errata may only be appended to the list | |
836 | * and must contain corresponding documentation at the above link. | |
837 | */ | |
838 | typedef enum zpool_errata { | |
839 | ZPOOL_ERRATA_NONE, | |
4f2dcb3e RY |
840 | ZPOOL_ERRATA_ZOL_2094_SCRUB, |
841 | ZPOOL_ERRATA_ZOL_2094_ASYNC_DESTROY, | |
ffe9d382 | 842 | } zpool_errata_t; |
428870ff | 843 | |
34dc7c2f BB |
844 | /* |
845 | * Vdev statistics. Note: all fields should be 64-bit because this | |
846 | * is passed between kernel and userland as an nvlist uint64 array. | |
847 | */ | |
848 | typedef struct vdev_stat { | |
849 | hrtime_t vs_timestamp; /* time since vdev load */ | |
850 | uint64_t vs_state; /* vdev state */ | |
851 | uint64_t vs_aux; /* see vdev_aux_t */ | |
852 | uint64_t vs_alloc; /* space allocated */ | |
853 | uint64_t vs_space; /* total capacity */ | |
854 | uint64_t vs_dspace; /* deflated capacity */ | |
855 | uint64_t vs_rsize; /* replaceable dev size */ | |
1bd201e7 | 856 | uint64_t vs_esize; /* expandable dev size */ |
34dc7c2f BB |
857 | uint64_t vs_ops[ZIO_TYPES]; /* operation count */ |
858 | uint64_t vs_bytes[ZIO_TYPES]; /* bytes read/written */ | |
859 | uint64_t vs_read_errors; /* read errors */ | |
860 | uint64_t vs_write_errors; /* write errors */ | |
861 | uint64_t vs_checksum_errors; /* checksum errors */ | |
862 | uint64_t vs_self_healed; /* self-healed bytes */ | |
428870ff BB |
863 | uint64_t vs_scan_removing; /* removing? */ |
864 | uint64_t vs_scan_processed; /* scan processed bytes */ | |
f3a7f661 | 865 | uint64_t vs_fragmentation; /* device fragmentation */ |
193a37cb | 866 | |
34dc7c2f BB |
867 | } vdev_stat_t; |
868 | ||
193a37cb TH |
869 | /* |
870 | * Extended stats | |
871 | * | |
872 | * These are stats which aren't included in the original iostat output. For | |
873 | * convenience, they are grouped together in vdev_stat_ex, although each stat | |
d5884c34 | 874 | * is individually exported as an nvlist. |
193a37cb TH |
875 | */ |
876 | typedef struct vdev_stat_ex { | |
877 | /* Number of ZIOs issued to disk and waiting to finish */ | |
878 | uint64_t vsx_active_queue[ZIO_PRIORITY_NUM_QUEUEABLE]; | |
879 | ||
880 | /* Number of ZIOs pending to be issued to disk */ | |
881 | uint64_t vsx_pend_queue[ZIO_PRIORITY_NUM_QUEUEABLE]; | |
882 | ||
883 | /* | |
884 | * Below are the histograms for various latencies. Buckets are in | |
885 | * units of nanoseconds. | |
886 | */ | |
887 | ||
888 | /* | |
889 | * 2^37 nanoseconds = 134s. Timeouts will probably start kicking in | |
890 | * before this. | |
891 | */ | |
7e945072 TH |
892 | #define VDEV_L_HISTO_BUCKETS 37 /* Latency histo buckets */ |
893 | #define VDEV_RQ_HISTO_BUCKETS 25 /* Request size histo buckets */ | |
894 | ||
193a37cb TH |
895 | |
896 | /* Amount of time in ZIO queue (ns) */ | |
897 | uint64_t vsx_queue_histo[ZIO_PRIORITY_NUM_QUEUEABLE] | |
7e945072 | 898 | [VDEV_L_HISTO_BUCKETS]; |
193a37cb TH |
899 | |
900 | /* Total ZIO latency (ns). Includes queuing and disk access time */ | |
7e945072 | 901 | uint64_t vsx_total_histo[ZIO_TYPES][VDEV_L_HISTO_BUCKETS]; |
193a37cb TH |
902 | |
903 | /* Amount of time to read/write the disk (ns) */ | |
7e945072 TH |
904 | uint64_t vsx_disk_histo[ZIO_TYPES][VDEV_L_HISTO_BUCKETS]; |
905 | ||
906 | /* "lookup the bucket for a value" histogram macros */ | |
907 | #define HISTO(val, buckets) (val != 0 ? MIN(highbit64(val) - 1, \ | |
908 | buckets - 1) : 0) | |
909 | #define L_HISTO(a) HISTO(a, VDEV_L_HISTO_BUCKETS) | |
910 | #define RQ_HISTO(a) HISTO(a, VDEV_RQ_HISTO_BUCKETS) | |
911 | ||
912 | /* Physical IO histogram */ | |
913 | uint64_t vsx_ind_histo[ZIO_PRIORITY_NUM_QUEUEABLE] | |
914 | [VDEV_RQ_HISTO_BUCKETS]; | |
193a37cb | 915 | |
7e945072 TH |
916 | /* Delegated (aggregated) physical IO histogram */ |
917 | uint64_t vsx_agg_histo[ZIO_PRIORITY_NUM_QUEUEABLE] | |
918 | [VDEV_RQ_HISTO_BUCKETS]; | |
193a37cb TH |
919 | |
920 | } vdev_stat_ex_t; | |
921 | ||
428870ff BB |
922 | /* |
923 | * DDT statistics. Note: all fields should be 64-bit because this | |
924 | * is passed between kernel and userland as an nvlist uint64 array. | |
925 | */ | |
926 | typedef struct ddt_object { | |
4e33ba4c | 927 | uint64_t ddo_count; /* number of elements in ddt */ |
428870ff BB |
928 | uint64_t ddo_dspace; /* size of ddt on disk */ |
929 | uint64_t ddo_mspace; /* size of ddt in-core */ | |
930 | } ddt_object_t; | |
931 | ||
932 | typedef struct ddt_stat { | |
933 | uint64_t dds_blocks; /* blocks */ | |
934 | uint64_t dds_lsize; /* logical size */ | |
935 | uint64_t dds_psize; /* physical size */ | |
936 | uint64_t dds_dsize; /* deflated allocated size */ | |
937 | uint64_t dds_ref_blocks; /* referenced blocks */ | |
938 | uint64_t dds_ref_lsize; /* referenced lsize * refcnt */ | |
939 | uint64_t dds_ref_psize; /* referenced psize * refcnt */ | |
940 | uint64_t dds_ref_dsize; /* referenced dsize * refcnt */ | |
941 | } ddt_stat_t; | |
942 | ||
943 | typedef struct ddt_histogram { | |
944 | ddt_stat_t ddh_stat[64]; /* power-of-two histogram buckets */ | |
945 | } ddt_histogram_t; | |
946 | ||
34dc7c2f BB |
947 | #define ZVOL_DRIVER "zvol" |
948 | #define ZFS_DRIVER "zfs" | |
949 | #define ZFS_DEV "/dev/zfs" | |
2bac6814 | 950 | #define ZFS_SHARETAB "/etc/dfs/sharetab" |
34dc7c2f | 951 | |
774ee3c7 GM |
952 | #define ZFS_SUPER_MAGIC 0x2fc12fc1 |
953 | ||
428870ff | 954 | /* general zvol path */ |
60101509 BB |
955 | #define ZVOL_DIR "/dev" |
956 | ||
957 | #define ZVOL_MAJOR 230 | |
958 | #define ZVOL_MINOR_BITS 4 | |
959 | #define ZVOL_MINOR_MASK ((1U << ZVOL_MINOR_BITS) - 1) | |
960 | #define ZVOL_MINORS (1 << 4) | |
4c0d8e50 | 961 | #define ZVOL_DEV_NAME "zd" |
34dc7c2f BB |
962 | |
963 | #define ZVOL_PROP_NAME "name" | |
428870ff | 964 | #define ZVOL_DEFAULT_BLOCKSIZE 8192 |
34dc7c2f BB |
965 | |
966 | /* | |
967 | * /dev/zfs ioctl numbers. | |
968 | */ | |
34dc7c2f | 969 | typedef enum zfs_ioc { |
2e0358cb | 970 | /* |
43e52edd | 971 | * Illumos - 71/128 numbers reserved. |
2e0358cb | 972 | */ |
6f1ffb06 MA |
973 | ZFS_IOC_FIRST = ('Z' << 8), |
974 | ZFS_IOC = ZFS_IOC_FIRST, | |
975 | ZFS_IOC_POOL_CREATE = ZFS_IOC_FIRST, | |
34dc7c2f BB |
976 | ZFS_IOC_POOL_DESTROY, |
977 | ZFS_IOC_POOL_IMPORT, | |
978 | ZFS_IOC_POOL_EXPORT, | |
979 | ZFS_IOC_POOL_CONFIGS, | |
980 | ZFS_IOC_POOL_STATS, | |
981 | ZFS_IOC_POOL_TRYIMPORT, | |
428870ff | 982 | ZFS_IOC_POOL_SCAN, |
34dc7c2f BB |
983 | ZFS_IOC_POOL_FREEZE, |
984 | ZFS_IOC_POOL_UPGRADE, | |
985 | ZFS_IOC_POOL_GET_HISTORY, | |
986 | ZFS_IOC_VDEV_ADD, | |
987 | ZFS_IOC_VDEV_REMOVE, | |
988 | ZFS_IOC_VDEV_SET_STATE, | |
989 | ZFS_IOC_VDEV_ATTACH, | |
990 | ZFS_IOC_VDEV_DETACH, | |
991 | ZFS_IOC_VDEV_SETPATH, | |
9babb374 | 992 | ZFS_IOC_VDEV_SETFRU, |
34dc7c2f BB |
993 | ZFS_IOC_OBJSET_STATS, |
994 | ZFS_IOC_OBJSET_ZPLPROPS, | |
995 | ZFS_IOC_DATASET_LIST_NEXT, | |
996 | ZFS_IOC_SNAPSHOT_LIST_NEXT, | |
997 | ZFS_IOC_SET_PROP, | |
34dc7c2f BB |
998 | ZFS_IOC_CREATE, |
999 | ZFS_IOC_DESTROY, | |
1000 | ZFS_IOC_ROLLBACK, | |
1001 | ZFS_IOC_RENAME, | |
1002 | ZFS_IOC_RECV, | |
1003 | ZFS_IOC_SEND, | |
1004 | ZFS_IOC_INJECT_FAULT, | |
1005 | ZFS_IOC_CLEAR_FAULT, | |
1006 | ZFS_IOC_INJECT_LIST_NEXT, | |
1007 | ZFS_IOC_ERROR_LOG, | |
1008 | ZFS_IOC_CLEAR, | |
1009 | ZFS_IOC_PROMOTE, | |
34dc7c2f BB |
1010 | ZFS_IOC_SNAPSHOT, |
1011 | ZFS_IOC_DSOBJ_TO_DSNAME, | |
1012 | ZFS_IOC_OBJ_TO_PATH, | |
1013 | ZFS_IOC_POOL_SET_PROPS, | |
1014 | ZFS_IOC_POOL_GET_PROPS, | |
1015 | ZFS_IOC_SET_FSACL, | |
1016 | ZFS_IOC_GET_FSACL, | |
34dc7c2f | 1017 | ZFS_IOC_SHARE, |
9babb374 BB |
1018 | ZFS_IOC_INHERIT_PROP, |
1019 | ZFS_IOC_SMB_ACL, | |
1020 | ZFS_IOC_USERSPACE_ONE, | |
1021 | ZFS_IOC_USERSPACE_MANY, | |
45d1cae3 BB |
1022 | ZFS_IOC_USERSPACE_UPGRADE, |
1023 | ZFS_IOC_HOLD, | |
1024 | ZFS_IOC_RELEASE, | |
428870ff BB |
1025 | ZFS_IOC_GET_HOLDS, |
1026 | ZFS_IOC_OBJSET_RECVD_PROPS, | |
572e2857 BB |
1027 | ZFS_IOC_VDEV_SPLIT, |
1028 | ZFS_IOC_NEXT_OBJ, | |
1029 | ZFS_IOC_DIFF, | |
1030 | ZFS_IOC_TMP_SNAPSHOT, | |
26685276 | 1031 | ZFS_IOC_OBJ_TO_STATS, |
330d06f9 MA |
1032 | ZFS_IOC_SPACE_WRITTEN, |
1033 | ZFS_IOC_SPACE_SNAPS, | |
2e0358cb BB |
1034 | ZFS_IOC_DESTROY_SNAPS, |
1035 | ZFS_IOC_POOL_REGUID, | |
1bd201e7 | 1036 | ZFS_IOC_POOL_REOPEN, |
37abac6d | 1037 | ZFS_IOC_SEND_PROGRESS, |
6f1ffb06 MA |
1038 | ZFS_IOC_LOG_HISTORY, |
1039 | ZFS_IOC_SEND_NEW, | |
1040 | ZFS_IOC_SEND_SPACE, | |
1041 | ZFS_IOC_CLONE, | |
da536844 MA |
1042 | ZFS_IOC_BOOKMARK, |
1043 | ZFS_IOC_GET_BOOKMARKS, | |
1044 | ZFS_IOC_DESTROY_BOOKMARKS, | |
43e52edd | 1045 | ZFS_IOC_RECV_NEW, |
bec1067d | 1046 | ZFS_IOC_POOL_SYNC, |
2e0358cb BB |
1047 | |
1048 | /* | |
1049 | * Linux - 3/64 numbers reserved. | |
1050 | */ | |
1051 | ZFS_IOC_LINUX = ('Z' << 8) + 0x80, | |
1052 | ZFS_IOC_EVENTS_NEXT, | |
1053 | ZFS_IOC_EVENTS_CLEAR, | |
75e3ff58 | 1054 | ZFS_IOC_EVENTS_SEEK, |
2e0358cb BB |
1055 | |
1056 | /* | |
1057 | * FreeBSD - 1/64 numbers reserved. | |
1058 | */ | |
1059 | ZFS_IOC_FREEBSD = ('Z' << 8) + 0xC0, | |
1060 | ||
6f1ffb06 | 1061 | ZFS_IOC_LAST |
34dc7c2f BB |
1062 | } zfs_ioc_t; |
1063 | ||
4c0d8e50 FN |
1064 | /* |
1065 | * zvol ioctl to get dataset name | |
1066 | */ | |
eca7b760 | 1067 | #define BLKZNAME _IOR(0x12, 125, char[ZFS_MAX_DATASET_NAME_LEN]) |
4c0d8e50 | 1068 | |
34dc7c2f BB |
1069 | /* |
1070 | * Internal SPA load state. Used by FMA diagnosis engine. | |
1071 | */ | |
1072 | typedef enum { | |
428870ff BB |
1073 | SPA_LOAD_NONE, /* no load in progress */ |
1074 | SPA_LOAD_OPEN, /* normal open */ | |
1075 | SPA_LOAD_IMPORT, /* import in progress */ | |
1076 | SPA_LOAD_TRYIMPORT, /* tryimport in progress */ | |
1077 | SPA_LOAD_RECOVER, /* recovery requested */ | |
3dfb57a3 DB |
1078 | SPA_LOAD_ERROR, /* load failed */ |
1079 | SPA_LOAD_CREATE /* creation in progress */ | |
34dc7c2f BB |
1080 | } spa_load_state_t; |
1081 | ||
1082 | /* | |
1083 | * Bookmark name values. | |
1084 | */ | |
1085 | #define ZPOOL_ERR_LIST "error list" | |
1086 | #define ZPOOL_ERR_DATASET "dataset" | |
1087 | #define ZPOOL_ERR_OBJECT "object" | |
1088 | ||
1089 | #define HIS_MAX_RECORD_LEN (MAXPATHLEN + MAXPATHLEN + 1) | |
1090 | ||
1091 | /* | |
1092 | * The following are names used in the nvlist describing | |
1093 | * the pool's history log. | |
1094 | */ | |
1095 | #define ZPOOL_HIST_RECORD "history record" | |
1096 | #define ZPOOL_HIST_TIME "history time" | |
1097 | #define ZPOOL_HIST_CMD "history command" | |
1098 | #define ZPOOL_HIST_WHO "history who" | |
1099 | #define ZPOOL_HIST_ZONE "history zone" | |
1100 | #define ZPOOL_HIST_HOST "history hostname" | |
1101 | #define ZPOOL_HIST_TXG "history txg" | |
1102 | #define ZPOOL_HIST_INT_EVENT "history internal event" | |
1103 | #define ZPOOL_HIST_INT_STR "history internal str" | |
6f1ffb06 MA |
1104 | #define ZPOOL_HIST_INT_NAME "internal_name" |
1105 | #define ZPOOL_HIST_IOCTL "ioctl" | |
1106 | #define ZPOOL_HIST_INPUT_NVL "in_nvl" | |
1107 | #define ZPOOL_HIST_OUTPUT_NVL "out_nvl" | |
1108 | #define ZPOOL_HIST_DSNAME "dsname" | |
1109 | #define ZPOOL_HIST_DSID "dsid" | |
34dc7c2f BB |
1110 | |
1111 | /* | |
1112 | * Flags for ZFS_IOC_VDEV_SET_STATE | |
1113 | */ | |
1114 | #define ZFS_ONLINE_CHECKREMOVE 0x1 | |
1115 | #define ZFS_ONLINE_UNSPARE 0x2 | |
1116 | #define ZFS_ONLINE_FORCEFAULT 0x4 | |
9babb374 | 1117 | #define ZFS_ONLINE_EXPAND 0x8 |
34dc7c2f BB |
1118 | #define ZFS_OFFLINE_TEMPORARY 0x1 |
1119 | ||
572e2857 BB |
1120 | /* |
1121 | * Flags for ZFS_IOC_POOL_IMPORT | |
1122 | */ | |
1123 | #define ZFS_IMPORT_NORMAL 0x0 | |
1124 | #define ZFS_IMPORT_VERBATIM 0x1 | |
1125 | #define ZFS_IMPORT_ANY_HOST 0x2 | |
1126 | #define ZFS_IMPORT_MISSING_LOG 0x4 | |
1127 | #define ZFS_IMPORT_ONLY 0x8 | |
26b42f3f | 1128 | #define ZFS_IMPORT_TEMP_NAME 0x10 |
572e2857 | 1129 | |
34dc7c2f BB |
1130 | /* |
1131 | * Sysevent payload members. ZFS will generate the following sysevents with the | |
1132 | * given payloads: | |
1133 | * | |
1134 | * ESC_ZFS_RESILVER_START | |
1135 | * ESC_ZFS_RESILVER_END | |
1136 | * ESC_ZFS_POOL_DESTROY | |
3541dc6d | 1137 | * ESC_ZFS_POOL_REGUID |
34dc7c2f BB |
1138 | * |
1139 | * ZFS_EV_POOL_NAME DATA_TYPE_STRING | |
1140 | * ZFS_EV_POOL_GUID DATA_TYPE_UINT64 | |
1141 | * | |
1142 | * ESC_ZFS_VDEV_REMOVE | |
1143 | * ESC_ZFS_VDEV_CLEAR | |
1144 | * ESC_ZFS_VDEV_CHECK | |
1145 | * | |
1146 | * ZFS_EV_POOL_NAME DATA_TYPE_STRING | |
1147 | * ZFS_EV_POOL_GUID DATA_TYPE_UINT64 | |
1148 | * ZFS_EV_VDEV_PATH DATA_TYPE_STRING (optional) | |
1149 | * ZFS_EV_VDEV_GUID DATA_TYPE_UINT64 | |
12fa0466 DE |
1150 | * |
1151 | * ESC_ZFS_HISTORY_EVENT | |
1152 | * | |
1153 | * ZFS_EV_POOL_NAME DATA_TYPE_STRING | |
1154 | * ZFS_EV_POOL_GUID DATA_TYPE_UINT64 | |
1155 | * ZFS_EV_HIST_TIME DATA_TYPE_UINT64 (optional) | |
1156 | * ZFS_EV_HIST_CMD DATA_TYPE_STRING (optional) | |
1157 | * ZFS_EV_HIST_WHO DATA_TYPE_UINT64 (optional) | |
1158 | * ZFS_EV_HIST_ZONE DATA_TYPE_STRING (optional) | |
1159 | * ZFS_EV_HIST_HOST DATA_TYPE_STRING (optional) | |
1160 | * ZFS_EV_HIST_TXG DATA_TYPE_UINT64 (optional) | |
1161 | * ZFS_EV_HIST_INT_EVENT DATA_TYPE_UINT64 (optional) | |
1162 | * ZFS_EV_HIST_INT_STR DATA_TYPE_STRING (optional) | |
1163 | * ZFS_EV_HIST_INT_NAME DATA_TYPE_STRING (optional) | |
1164 | * ZFS_EV_HIST_IOCTL DATA_TYPE_STRING (optional) | |
1165 | * ZFS_EV_HIST_DSNAME DATA_TYPE_STRING (optional) | |
1166 | * ZFS_EV_HIST_DSID DATA_TYPE_UINT64 (optional) | |
1167 | * | |
1168 | * The ZFS_EV_HIST_* members will correspond to the ZPOOL_HIST_* members in the | |
1169 | * history log nvlist. The keynames will be free of any spaces or other | |
1170 | * characters that could be potentially unexpected to consumers of the | |
1171 | * sysevents. | |
34dc7c2f BB |
1172 | */ |
1173 | #define ZFS_EV_POOL_NAME "pool_name" | |
1174 | #define ZFS_EV_POOL_GUID "pool_guid" | |
1175 | #define ZFS_EV_VDEV_PATH "vdev_path" | |
1176 | #define ZFS_EV_VDEV_GUID "vdev_guid" | |
12fa0466 DE |
1177 | #define ZFS_EV_HIST_TIME "history_time" |
1178 | #define ZFS_EV_HIST_CMD "history_command" | |
1179 | #define ZFS_EV_HIST_WHO "history_who" | |
1180 | #define ZFS_EV_HIST_ZONE "history_zone" | |
1181 | #define ZFS_EV_HIST_HOST "history_hostname" | |
1182 | #define ZFS_EV_HIST_TXG "history_txg" | |
1183 | #define ZFS_EV_HIST_INT_EVENT "history_internal_event" | |
1184 | #define ZFS_EV_HIST_INT_STR "history_internal_str" | |
1185 | #define ZFS_EV_HIST_INT_NAME "history_internal_name" | |
1186 | #define ZFS_EV_HIST_IOCTL "history_ioctl" | |
1187 | #define ZFS_EV_HIST_DSNAME "history_dsname" | |
1188 | #define ZFS_EV_HIST_DSID "history_dsid" | |
34dc7c2f | 1189 | |
34dc7c2f BB |
1190 | #ifdef __cplusplus |
1191 | } | |
1192 | #endif | |
1193 | ||
1194 | #endif /* _SYS_FS_ZFS_H */ |