Print this page
2882 implement libzfs_core
2883 changing "canmount" property to "on" should not always remount dataset
2900 "zfs snapshot" should be able to create multiple, arbitrary snapshots at once
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Chris Siden <christopher.siden@delphix.com>
Reviewed by: Garrett D'Amore <garrett@damore.org>
Reviewed by: Bill Pijewski <wdp@joyent.com>
Reviewed by: Dan Kruchinin <dan.kruchinin@gmail.com>
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/sys/fs/zfs.h
+++ new/usr/src/uts/common/sys/fs/zfs.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21
22 22 /*
23 23 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
24 24 * Copyright (c) 2012 by Delphix. All rights reserved.
25 25 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
26 26 * Copyright (c) 2012, Joyent, Inc. All rights reserved.
27 27 */
28 28
29 29 /* Portions Copyright 2010 Robert Milkowski */
30 30
31 31 #ifndef _SYS_FS_ZFS_H
32 32 #define _SYS_FS_ZFS_H
33 33
34 34 #include <sys/time.h>
35 35
36 36 #ifdef __cplusplus
37 37 extern "C" {
38 38 #endif
39 39
40 40 /*
41 41 * Types and constants shared between userland and the kernel.
42 42 */
43 43
44 44 /*
↓ open down ↓ |
44 lines elided |
↑ open up ↑ |
45 45 * Each dataset can be one of the following types. These constants can be
46 46 * combined into masks that can be passed to various functions.
47 47 */
48 48 typedef enum {
49 49 ZFS_TYPE_FILESYSTEM = 0x1,
50 50 ZFS_TYPE_SNAPSHOT = 0x2,
51 51 ZFS_TYPE_VOLUME = 0x4,
52 52 ZFS_TYPE_POOL = 0x8
53 53 } zfs_type_t;
54 54
55 +typedef enum dmu_objset_type {
56 + DMU_OST_NONE,
57 + DMU_OST_META,
58 + DMU_OST_ZFS,
59 + DMU_OST_ZVOL,
60 + DMU_OST_OTHER, /* For testing only! */
61 + DMU_OST_ANY, /* Be careful! */
62 + DMU_OST_NUMTYPES
63 +} dmu_objset_type_t;
64 +
55 65 #define ZFS_TYPE_DATASET \
56 66 (ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME | ZFS_TYPE_SNAPSHOT)
57 67
58 68 #define ZAP_MAXNAMELEN 256
59 69 #define ZAP_MAXVALUELEN (1024 * 8)
60 70 #define ZAP_OLDMAXVALUELEN 1024
61 71
62 72 /*
63 73 * Dataset properties are identified by these constants and must be added to
64 74 * the end of this list to ensure that external consumers are not affected
65 75 * by the change. If you make any changes to this list, be sure to update
66 76 * the property table in usr/src/common/zfs/zfs_prop.c.
67 77 */
68 78 typedef enum {
69 79 ZFS_PROP_TYPE,
70 80 ZFS_PROP_CREATION,
71 81 ZFS_PROP_USED,
72 82 ZFS_PROP_AVAILABLE,
73 83 ZFS_PROP_REFERENCED,
74 84 ZFS_PROP_COMPRESSRATIO,
75 85 ZFS_PROP_MOUNTED,
76 86 ZFS_PROP_ORIGIN,
77 87 ZFS_PROP_QUOTA,
78 88 ZFS_PROP_RESERVATION,
79 89 ZFS_PROP_VOLSIZE,
80 90 ZFS_PROP_VOLBLOCKSIZE,
81 91 ZFS_PROP_RECORDSIZE,
82 92 ZFS_PROP_MOUNTPOINT,
83 93 ZFS_PROP_SHARENFS,
84 94 ZFS_PROP_CHECKSUM,
85 95 ZFS_PROP_COMPRESSION,
86 96 ZFS_PROP_ATIME,
87 97 ZFS_PROP_DEVICES,
88 98 ZFS_PROP_EXEC,
89 99 ZFS_PROP_SETUID,
90 100 ZFS_PROP_READONLY,
91 101 ZFS_PROP_ZONED,
92 102 ZFS_PROP_SNAPDIR,
93 103 ZFS_PROP_ACLMODE,
94 104 ZFS_PROP_ACLINHERIT,
95 105 ZFS_PROP_CREATETXG, /* not exposed to the user */
96 106 ZFS_PROP_NAME, /* not exposed to the user */
97 107 ZFS_PROP_CANMOUNT,
98 108 ZFS_PROP_ISCSIOPTIONS, /* not exposed to the user */
99 109 ZFS_PROP_XATTR,
100 110 ZFS_PROP_NUMCLONES, /* not exposed to the user */
101 111 ZFS_PROP_COPIES,
102 112 ZFS_PROP_VERSION,
103 113 ZFS_PROP_UTF8ONLY,
104 114 ZFS_PROP_NORMALIZE,
105 115 ZFS_PROP_CASE,
106 116 ZFS_PROP_VSCAN,
107 117 ZFS_PROP_NBMAND,
108 118 ZFS_PROP_SHARESMB,
109 119 ZFS_PROP_REFQUOTA,
110 120 ZFS_PROP_REFRESERVATION,
111 121 ZFS_PROP_GUID,
112 122 ZFS_PROP_PRIMARYCACHE,
113 123 ZFS_PROP_SECONDARYCACHE,
114 124 ZFS_PROP_USEDSNAP,
115 125 ZFS_PROP_USEDDS,
116 126 ZFS_PROP_USEDCHILD,
117 127 ZFS_PROP_USEDREFRESERV,
118 128 ZFS_PROP_USERACCOUNTING, /* not exposed to the user */
119 129 ZFS_PROP_STMF_SHAREINFO, /* not exposed to the user */
120 130 ZFS_PROP_DEFER_DESTROY,
121 131 ZFS_PROP_USERREFS,
122 132 ZFS_PROP_LOGBIAS,
123 133 ZFS_PROP_UNIQUE, /* not exposed to the user */
124 134 ZFS_PROP_OBJSETID, /* not exposed to the user */
125 135 ZFS_PROP_DEDUP,
126 136 ZFS_PROP_MLSLABEL,
127 137 ZFS_PROP_SYNC,
128 138 ZFS_PROP_REFRATIO,
129 139 ZFS_PROP_WRITTEN,
130 140 ZFS_PROP_CLONES,
131 141 ZFS_NUM_PROPS
132 142 } zfs_prop_t;
133 143
134 144 typedef enum {
135 145 ZFS_PROP_USERUSED,
136 146 ZFS_PROP_USERQUOTA,
137 147 ZFS_PROP_GROUPUSED,
138 148 ZFS_PROP_GROUPQUOTA,
139 149 ZFS_NUM_USERQUOTA_PROPS
140 150 } zfs_userquota_prop_t;
141 151
142 152 extern const char *zfs_userquota_prop_prefixes[ZFS_NUM_USERQUOTA_PROPS];
143 153
144 154 /*
145 155 * Pool properties are identified by these constants and must be added to the
146 156 * end of this list to ensure that external consumers are not affected
147 157 * by the change. If you make any changes to this list, be sure to update
148 158 * the property table in usr/src/common/zfs/zpool_prop.c.
149 159 */
150 160 typedef enum {
151 161 ZPOOL_PROP_NAME,
152 162 ZPOOL_PROP_SIZE,
153 163 ZPOOL_PROP_CAPACITY,
154 164 ZPOOL_PROP_ALTROOT,
155 165 ZPOOL_PROP_HEALTH,
156 166 ZPOOL_PROP_GUID,
157 167 ZPOOL_PROP_VERSION,
158 168 ZPOOL_PROP_BOOTFS,
159 169 ZPOOL_PROP_DELEGATION,
160 170 ZPOOL_PROP_AUTOREPLACE,
161 171 ZPOOL_PROP_CACHEFILE,
162 172 ZPOOL_PROP_FAILUREMODE,
163 173 ZPOOL_PROP_LISTSNAPS,
164 174 ZPOOL_PROP_AUTOEXPAND,
165 175 ZPOOL_PROP_DEDUPDITTO,
166 176 ZPOOL_PROP_DEDUPRATIO,
167 177 ZPOOL_PROP_FREE,
168 178 ZPOOL_PROP_ALLOCATED,
169 179 ZPOOL_PROP_READONLY,
170 180 ZPOOL_PROP_COMMENT,
171 181 ZPOOL_PROP_EXPANDSZ,
172 182 ZPOOL_PROP_FREEING,
173 183 ZPOOL_NUM_PROPS
174 184 } zpool_prop_t;
175 185
176 186 /* Small enough to not hog a whole line of printout in zpool(1M). */
177 187 #define ZPROP_MAX_COMMENT 32
178 188
179 189 #define ZPROP_CONT -2
180 190 #define ZPROP_INVAL -1
181 191
182 192 #define ZPROP_VALUE "value"
183 193 #define ZPROP_SOURCE "source"
184 194
185 195 typedef enum {
186 196 ZPROP_SRC_NONE = 0x1,
187 197 ZPROP_SRC_DEFAULT = 0x2,
188 198 ZPROP_SRC_TEMPORARY = 0x4,
189 199 ZPROP_SRC_LOCAL = 0x8,
190 200 ZPROP_SRC_INHERITED = 0x10,
191 201 ZPROP_SRC_RECEIVED = 0x20
192 202 } zprop_source_t;
193 203
194 204 #define ZPROP_SRC_ALL 0x3f
195 205
196 206 #define ZPROP_SOURCE_VAL_RECVD "$recvd"
197 207 #define ZPROP_N_MORE_ERRORS "N_MORE_ERRORS"
198 208 /*
199 209 * Dataset flag implemented as a special entry in the props zap object
200 210 * indicating that the dataset has received properties on or after
201 211 * SPA_VERSION_RECVD_PROPS. The first such receive blows away local properties
202 212 * just as it did in earlier versions, and thereafter, local properties are
203 213 * preserved.
204 214 */
205 215 #define ZPROP_HAS_RECVD "$hasrecvd"
206 216
207 217 typedef enum {
208 218 ZPROP_ERR_NOCLEAR = 0x1, /* failure to clear existing props */
209 219 ZPROP_ERR_NORESTORE = 0x2 /* failure to restore props on error */
210 220 } zprop_errflags_t;
211 221
212 222 typedef int (*zprop_func)(int, void *);
213 223
214 224 /*
215 225 * Properties to be set on the root file system of a new pool
216 226 * are stuffed into their own nvlist, which is then included in
217 227 * the properties nvlist with the pool properties.
218 228 */
219 229 #define ZPOOL_ROOTFS_PROPS "root-props-nvl"
220 230
221 231 /*
222 232 * Dataset property functions shared between libzfs and kernel.
223 233 */
224 234 const char *zfs_prop_default_string(zfs_prop_t);
225 235 uint64_t zfs_prop_default_numeric(zfs_prop_t);
226 236 boolean_t zfs_prop_readonly(zfs_prop_t);
227 237 boolean_t zfs_prop_inheritable(zfs_prop_t);
228 238 boolean_t zfs_prop_setonce(zfs_prop_t);
229 239 const char *zfs_prop_to_name(zfs_prop_t);
230 240 zfs_prop_t zfs_name_to_prop(const char *);
231 241 boolean_t zfs_prop_user(const char *);
232 242 boolean_t zfs_prop_userquota(const char *);
233 243 boolean_t zfs_prop_written(const char *);
234 244 int zfs_prop_index_to_string(zfs_prop_t, uint64_t, const char **);
235 245 int zfs_prop_string_to_index(zfs_prop_t, const char *, uint64_t *);
236 246 uint64_t zfs_prop_random_value(zfs_prop_t, uint64_t seed);
237 247 boolean_t zfs_prop_valid_for_type(int, zfs_type_t);
238 248
239 249 /*
240 250 * Pool property functions shared between libzfs and kernel.
241 251 */
242 252 zpool_prop_t zpool_name_to_prop(const char *);
243 253 const char *zpool_prop_to_name(zpool_prop_t);
244 254 const char *zpool_prop_default_string(zpool_prop_t);
245 255 uint64_t zpool_prop_default_numeric(zpool_prop_t);
246 256 boolean_t zpool_prop_readonly(zpool_prop_t);
247 257 boolean_t zpool_prop_feature(const char *);
248 258 boolean_t zpool_prop_unsupported(const char *name);
249 259 int zpool_prop_index_to_string(zpool_prop_t, uint64_t, const char **);
250 260 int zpool_prop_string_to_index(zpool_prop_t, const char *, uint64_t *);
251 261 uint64_t zpool_prop_random_value(zpool_prop_t, uint64_t seed);
252 262
253 263 /*
254 264 * Definitions for the Delegation.
255 265 */
256 266 typedef enum {
257 267 ZFS_DELEG_WHO_UNKNOWN = 0,
258 268 ZFS_DELEG_USER = 'u',
259 269 ZFS_DELEG_USER_SETS = 'U',
260 270 ZFS_DELEG_GROUP = 'g',
261 271 ZFS_DELEG_GROUP_SETS = 'G',
262 272 ZFS_DELEG_EVERYONE = 'e',
263 273 ZFS_DELEG_EVERYONE_SETS = 'E',
264 274 ZFS_DELEG_CREATE = 'c',
265 275 ZFS_DELEG_CREATE_SETS = 'C',
266 276 ZFS_DELEG_NAMED_SET = 's',
267 277 ZFS_DELEG_NAMED_SET_SETS = 'S'
268 278 } zfs_deleg_who_type_t;
269 279
270 280 typedef enum {
271 281 ZFS_DELEG_NONE = 0,
272 282 ZFS_DELEG_PERM_LOCAL = 1,
273 283 ZFS_DELEG_PERM_DESCENDENT = 2,
274 284 ZFS_DELEG_PERM_LOCALDESCENDENT = 3,
275 285 ZFS_DELEG_PERM_CREATE = 4
276 286 } zfs_deleg_inherit_t;
277 287
278 288 #define ZFS_DELEG_PERM_UID "uid"
279 289 #define ZFS_DELEG_PERM_GID "gid"
280 290 #define ZFS_DELEG_PERM_GROUPS "groups"
281 291
282 292 #define ZFS_MLSLABEL_DEFAULT "none"
283 293
284 294 #define ZFS_SMB_ACL_SRC "src"
285 295 #define ZFS_SMB_ACL_TARGET "target"
286 296
287 297 typedef enum {
288 298 ZFS_CANMOUNT_OFF = 0,
289 299 ZFS_CANMOUNT_ON = 1,
290 300 ZFS_CANMOUNT_NOAUTO = 2
291 301 } zfs_canmount_type_t;
292 302
293 303 typedef enum {
294 304 ZFS_LOGBIAS_LATENCY = 0,
295 305 ZFS_LOGBIAS_THROUGHPUT = 1
296 306 } zfs_logbias_op_t;
297 307
298 308 typedef enum zfs_share_op {
299 309 ZFS_SHARE_NFS = 0,
300 310 ZFS_UNSHARE_NFS = 1,
301 311 ZFS_SHARE_SMB = 2,
302 312 ZFS_UNSHARE_SMB = 3
303 313 } zfs_share_op_t;
304 314
305 315 typedef enum zfs_smb_acl_op {
306 316 ZFS_SMB_ACL_ADD,
307 317 ZFS_SMB_ACL_REMOVE,
308 318 ZFS_SMB_ACL_RENAME,
309 319 ZFS_SMB_ACL_PURGE
310 320 } zfs_smb_acl_op_t;
311 321
312 322 typedef enum zfs_cache_type {
313 323 ZFS_CACHE_NONE = 0,
314 324 ZFS_CACHE_METADATA = 1,
315 325 ZFS_CACHE_ALL = 2
316 326 } zfs_cache_type_t;
317 327
318 328 typedef enum {
319 329 ZFS_SYNC_STANDARD = 0,
320 330 ZFS_SYNC_ALWAYS = 1,
321 331 ZFS_SYNC_DISABLED = 2
322 332 } zfs_sync_type_t;
323 333
324 334
325 335 /*
326 336 * On-disk version number.
327 337 */
328 338 #define SPA_VERSION_1 1ULL
329 339 #define SPA_VERSION_2 2ULL
330 340 #define SPA_VERSION_3 3ULL
331 341 #define SPA_VERSION_4 4ULL
332 342 #define SPA_VERSION_5 5ULL
333 343 #define SPA_VERSION_6 6ULL
334 344 #define SPA_VERSION_7 7ULL
335 345 #define SPA_VERSION_8 8ULL
336 346 #define SPA_VERSION_9 9ULL
337 347 #define SPA_VERSION_10 10ULL
338 348 #define SPA_VERSION_11 11ULL
339 349 #define SPA_VERSION_12 12ULL
340 350 #define SPA_VERSION_13 13ULL
341 351 #define SPA_VERSION_14 14ULL
342 352 #define SPA_VERSION_15 15ULL
343 353 #define SPA_VERSION_16 16ULL
344 354 #define SPA_VERSION_17 17ULL
345 355 #define SPA_VERSION_18 18ULL
346 356 #define SPA_VERSION_19 19ULL
347 357 #define SPA_VERSION_20 20ULL
348 358 #define SPA_VERSION_21 21ULL
349 359 #define SPA_VERSION_22 22ULL
350 360 #define SPA_VERSION_23 23ULL
351 361 #define SPA_VERSION_24 24ULL
352 362 #define SPA_VERSION_25 25ULL
353 363 #define SPA_VERSION_26 26ULL
354 364 #define SPA_VERSION_27 27ULL
355 365 #define SPA_VERSION_28 28ULL
356 366 #define SPA_VERSION_5000 5000ULL
357 367
358 368 /*
359 369 * When bumping up SPA_VERSION, make sure GRUB ZFS understands the on-disk
360 370 * format change. Go to usr/src/grub/grub-0.97/stage2/{zfs-include/, fsys_zfs*},
361 371 * and do the appropriate changes. Also bump the version number in
362 372 * usr/src/grub/capability.
363 373 */
364 374 #define SPA_VERSION SPA_VERSION_5000
365 375 #define SPA_VERSION_STRING "5000"
366 376
367 377 /*
368 378 * Symbolic names for the changes that caused a SPA_VERSION switch.
369 379 * Used in the code when checking for presence or absence of a feature.
370 380 * Feel free to define multiple symbolic names for each version if there
371 381 * were multiple changes to on-disk structures during that version.
372 382 *
373 383 * NOTE: When checking the current SPA_VERSION in your code, be sure
374 384 * to use spa_version() since it reports the version of the
375 385 * last synced uberblock. Checking the in-flight version can
376 386 * be dangerous in some cases.
377 387 */
378 388 #define SPA_VERSION_INITIAL SPA_VERSION_1
379 389 #define SPA_VERSION_DITTO_BLOCKS SPA_VERSION_2
380 390 #define SPA_VERSION_SPARES SPA_VERSION_3
381 391 #define SPA_VERSION_RAIDZ2 SPA_VERSION_3
382 392 #define SPA_VERSION_BPOBJ_ACCOUNT SPA_VERSION_3
383 393 #define SPA_VERSION_RAIDZ_DEFLATE SPA_VERSION_3
384 394 #define SPA_VERSION_DNODE_BYTES SPA_VERSION_3
385 395 #define SPA_VERSION_ZPOOL_HISTORY SPA_VERSION_4
386 396 #define SPA_VERSION_GZIP_COMPRESSION SPA_VERSION_5
387 397 #define SPA_VERSION_BOOTFS SPA_VERSION_6
388 398 #define SPA_VERSION_SLOGS SPA_VERSION_7
389 399 #define SPA_VERSION_DELEGATED_PERMS SPA_VERSION_8
390 400 #define SPA_VERSION_FUID SPA_VERSION_9
391 401 #define SPA_VERSION_REFRESERVATION SPA_VERSION_9
392 402 #define SPA_VERSION_REFQUOTA SPA_VERSION_9
393 403 #define SPA_VERSION_UNIQUE_ACCURATE SPA_VERSION_9
394 404 #define SPA_VERSION_L2CACHE SPA_VERSION_10
395 405 #define SPA_VERSION_NEXT_CLONES SPA_VERSION_11
396 406 #define SPA_VERSION_ORIGIN SPA_VERSION_11
397 407 #define SPA_VERSION_DSL_SCRUB SPA_VERSION_11
398 408 #define SPA_VERSION_SNAP_PROPS SPA_VERSION_12
399 409 #define SPA_VERSION_USED_BREAKDOWN SPA_VERSION_13
400 410 #define SPA_VERSION_PASSTHROUGH_X SPA_VERSION_14
401 411 #define SPA_VERSION_USERSPACE SPA_VERSION_15
402 412 #define SPA_VERSION_STMF_PROP SPA_VERSION_16
403 413 #define SPA_VERSION_RAIDZ3 SPA_VERSION_17
404 414 #define SPA_VERSION_USERREFS SPA_VERSION_18
405 415 #define SPA_VERSION_HOLES SPA_VERSION_19
406 416 #define SPA_VERSION_ZLE_COMPRESSION SPA_VERSION_20
407 417 #define SPA_VERSION_DEDUP SPA_VERSION_21
408 418 #define SPA_VERSION_RECVD_PROPS SPA_VERSION_22
409 419 #define SPA_VERSION_SLIM_ZIL SPA_VERSION_23
410 420 #define SPA_VERSION_SA SPA_VERSION_24
411 421 #define SPA_VERSION_SCAN SPA_VERSION_25
412 422 #define SPA_VERSION_DIR_CLONES SPA_VERSION_26
413 423 #define SPA_VERSION_DEADLISTS SPA_VERSION_26
414 424 #define SPA_VERSION_FAST_SNAP SPA_VERSION_27
415 425 #define SPA_VERSION_MULTI_REPLACE SPA_VERSION_28
416 426 #define SPA_VERSION_BEFORE_FEATURES SPA_VERSION_28
417 427 #define SPA_VERSION_FEATURES SPA_VERSION_5000
418 428
419 429 #define SPA_VERSION_IS_SUPPORTED(v) \
420 430 (((v) >= SPA_VERSION_INITIAL && (v) <= SPA_VERSION_BEFORE_FEATURES) || \
421 431 ((v) >= SPA_VERSION_FEATURES && (v) <= SPA_VERSION))
422 432
423 433 /*
424 434 * ZPL version - rev'd whenever an incompatible on-disk format change
425 435 * occurs. This is independent of SPA/DMU/ZAP versioning. You must
426 436 * also update the version_table[] and help message in zfs_prop.c.
427 437 *
428 438 * When changing, be sure to teach GRUB how to read the new format!
429 439 * See usr/src/grub/grub-0.97/stage2/{zfs-include/,fsys_zfs*}
430 440 */
431 441 #define ZPL_VERSION_1 1ULL
432 442 #define ZPL_VERSION_2 2ULL
433 443 #define ZPL_VERSION_3 3ULL
434 444 #define ZPL_VERSION_4 4ULL
435 445 #define ZPL_VERSION_5 5ULL
436 446 #define ZPL_VERSION ZPL_VERSION_5
437 447 #define ZPL_VERSION_STRING "5"
438 448
439 449 #define ZPL_VERSION_INITIAL ZPL_VERSION_1
440 450 #define ZPL_VERSION_DIRENT_TYPE ZPL_VERSION_2
441 451 #define ZPL_VERSION_FUID ZPL_VERSION_3
442 452 #define ZPL_VERSION_NORMALIZATION ZPL_VERSION_3
443 453 #define ZPL_VERSION_SYSATTR ZPL_VERSION_3
444 454 #define ZPL_VERSION_USERSPACE ZPL_VERSION_4
445 455 #define ZPL_VERSION_SA ZPL_VERSION_5
446 456
447 457 /* Rewind request information */
448 458 #define ZPOOL_NO_REWIND 1 /* No policy - default behavior */
449 459 #define ZPOOL_NEVER_REWIND 2 /* Do not search for best txg or rewind */
450 460 #define ZPOOL_TRY_REWIND 4 /* Search for best txg, but do not rewind */
451 461 #define ZPOOL_DO_REWIND 8 /* Rewind to best txg w/in deferred frees */
452 462 #define ZPOOL_EXTREME_REWIND 16 /* Allow extreme measures to find best txg */
453 463 #define ZPOOL_REWIND_MASK 28 /* All the possible rewind bits */
454 464 #define ZPOOL_REWIND_POLICIES 31 /* All the possible policy bits */
455 465
456 466 typedef struct zpool_rewind_policy {
457 467 uint32_t zrp_request; /* rewind behavior requested */
458 468 uint64_t zrp_maxmeta; /* max acceptable meta-data errors */
459 469 uint64_t zrp_maxdata; /* max acceptable data errors */
460 470 uint64_t zrp_txg; /* specific txg to load */
461 471 } zpool_rewind_policy_t;
462 472
463 473 /*
464 474 * The following are configuration names used in the nvlist describing a pool's
465 475 * configuration.
466 476 */
467 477 #define ZPOOL_CONFIG_VERSION "version"
468 478 #define ZPOOL_CONFIG_POOL_NAME "name"
469 479 #define ZPOOL_CONFIG_POOL_STATE "state"
470 480 #define ZPOOL_CONFIG_POOL_TXG "txg"
471 481 #define ZPOOL_CONFIG_POOL_GUID "pool_guid"
472 482 #define ZPOOL_CONFIG_CREATE_TXG "create_txg"
473 483 #define ZPOOL_CONFIG_TOP_GUID "top_guid"
474 484 #define ZPOOL_CONFIG_VDEV_TREE "vdev_tree"
475 485 #define ZPOOL_CONFIG_TYPE "type"
476 486 #define ZPOOL_CONFIG_CHILDREN "children"
477 487 #define ZPOOL_CONFIG_ID "id"
478 488 #define ZPOOL_CONFIG_GUID "guid"
479 489 #define ZPOOL_CONFIG_PATH "path"
480 490 #define ZPOOL_CONFIG_DEVID "devid"
481 491 #define ZPOOL_CONFIG_METASLAB_ARRAY "metaslab_array"
482 492 #define ZPOOL_CONFIG_METASLAB_SHIFT "metaslab_shift"
483 493 #define ZPOOL_CONFIG_ASHIFT "ashift"
484 494 #define ZPOOL_CONFIG_ASIZE "asize"
485 495 #define ZPOOL_CONFIG_DTL "DTL"
486 496 #define ZPOOL_CONFIG_SCAN_STATS "scan_stats" /* not stored on disk */
487 497 #define ZPOOL_CONFIG_VDEV_STATS "vdev_stats" /* not stored on disk */
488 498 #define ZPOOL_CONFIG_WHOLE_DISK "whole_disk"
489 499 #define ZPOOL_CONFIG_ERRCOUNT "error_count"
490 500 #define ZPOOL_CONFIG_NOT_PRESENT "not_present"
491 501 #define ZPOOL_CONFIG_SPARES "spares"
492 502 #define ZPOOL_CONFIG_IS_SPARE "is_spare"
493 503 #define ZPOOL_CONFIG_NPARITY "nparity"
494 504 #define ZPOOL_CONFIG_HOSTID "hostid"
495 505 #define ZPOOL_CONFIG_HOSTNAME "hostname"
496 506 #define ZPOOL_CONFIG_LOADED_TIME "initial_load_time"
497 507 #define ZPOOL_CONFIG_UNSPARE "unspare"
498 508 #define ZPOOL_CONFIG_PHYS_PATH "phys_path"
499 509 #define ZPOOL_CONFIG_IS_LOG "is_log"
500 510 #define ZPOOL_CONFIG_L2CACHE "l2cache"
501 511 #define ZPOOL_CONFIG_HOLE_ARRAY "hole_array"
502 512 #define ZPOOL_CONFIG_VDEV_CHILDREN "vdev_children"
503 513 #define ZPOOL_CONFIG_IS_HOLE "is_hole"
504 514 #define ZPOOL_CONFIG_DDT_HISTOGRAM "ddt_histogram"
505 515 #define ZPOOL_CONFIG_DDT_OBJ_STATS "ddt_object_stats"
506 516 #define ZPOOL_CONFIG_DDT_STATS "ddt_stats"
507 517 #define ZPOOL_CONFIG_SPLIT "splitcfg"
508 518 #define ZPOOL_CONFIG_ORIG_GUID "orig_guid"
509 519 #define ZPOOL_CONFIG_SPLIT_GUID "split_guid"
510 520 #define ZPOOL_CONFIG_SPLIT_LIST "guid_list"
511 521 #define ZPOOL_CONFIG_REMOVING "removing"
512 522 #define ZPOOL_CONFIG_RESILVERING "resilvering"
513 523 #define ZPOOL_CONFIG_COMMENT "comment"
514 524 #define ZPOOL_CONFIG_SUSPENDED "suspended" /* not stored on disk */
515 525 #define ZPOOL_CONFIG_TIMESTAMP "timestamp" /* not stored on disk */
516 526 #define ZPOOL_CONFIG_BOOTFS "bootfs" /* not stored on disk */
517 527 #define ZPOOL_CONFIG_MISSING_DEVICES "missing_vdevs" /* not stored on disk */
518 528 #define ZPOOL_CONFIG_LOAD_INFO "load_info" /* not stored on disk */
519 529 #define ZPOOL_CONFIG_REWIND_INFO "rewind_info" /* not stored on disk */
520 530 #define ZPOOL_CONFIG_UNSUP_FEAT "unsup_feat" /* not stored on disk */
521 531 #define ZPOOL_CONFIG_CAN_RDONLY "can_rdonly" /* not stored on disk */
522 532 #define ZPOOL_CONFIG_FEATURES_FOR_READ "features_for_read"
523 533 #define ZPOOL_CONFIG_FEATURE_STATS "feature_stats" /* not stored on disk */
524 534 /*
525 535 * The persistent vdev state is stored as separate values rather than a single
526 536 * 'vdev_state' entry. This is because a device can be in multiple states, such
527 537 * as offline and degraded.
528 538 */
529 539 #define ZPOOL_CONFIG_OFFLINE "offline"
530 540 #define ZPOOL_CONFIG_FAULTED "faulted"
531 541 #define ZPOOL_CONFIG_DEGRADED "degraded"
532 542 #define ZPOOL_CONFIG_REMOVED "removed"
533 543 #define ZPOOL_CONFIG_FRU "fru"
534 544 #define ZPOOL_CONFIG_AUX_STATE "aux_state"
535 545
536 546 /* Rewind policy parameters */
537 547 #define ZPOOL_REWIND_POLICY "rewind-policy"
538 548 #define ZPOOL_REWIND_REQUEST "rewind-request"
539 549 #define ZPOOL_REWIND_REQUEST_TXG "rewind-request-txg"
540 550 #define ZPOOL_REWIND_META_THRESH "rewind-meta-thresh"
541 551 #define ZPOOL_REWIND_DATA_THRESH "rewind-data-thresh"
542 552
543 553 /* Rewind data discovered */
544 554 #define ZPOOL_CONFIG_LOAD_TIME "rewind_txg_ts"
545 555 #define ZPOOL_CONFIG_LOAD_DATA_ERRORS "verify_data_errors"
546 556 #define ZPOOL_CONFIG_REWIND_TIME "seconds_of_rewind"
547 557
548 558 #define VDEV_TYPE_ROOT "root"
549 559 #define VDEV_TYPE_MIRROR "mirror"
550 560 #define VDEV_TYPE_REPLACING "replacing"
551 561 #define VDEV_TYPE_RAIDZ "raidz"
552 562 #define VDEV_TYPE_DISK "disk"
553 563 #define VDEV_TYPE_FILE "file"
554 564 #define VDEV_TYPE_MISSING "missing"
555 565 #define VDEV_TYPE_HOLE "hole"
556 566 #define VDEV_TYPE_SPARE "spare"
557 567 #define VDEV_TYPE_LOG "log"
558 568 #define VDEV_TYPE_L2CACHE "l2cache"
559 569
560 570 /*
561 571 * This is needed in userland to report the minimum necessary device size.
562 572 */
563 573 #define SPA_MINDEVSIZE (64ULL << 20)
564 574
565 575 /*
566 576 * The location of the pool configuration repository, shared between kernel and
567 577 * userland.
568 578 */
569 579 #define ZPOOL_CACHE "/etc/zfs/zpool.cache"
570 580
571 581 /*
572 582 * vdev states are ordered from least to most healthy.
573 583 * A vdev that's CANT_OPEN or below is considered unusable.
574 584 */
575 585 typedef enum vdev_state {
576 586 VDEV_STATE_UNKNOWN = 0, /* Uninitialized vdev */
577 587 VDEV_STATE_CLOSED, /* Not currently open */
578 588 VDEV_STATE_OFFLINE, /* Not allowed to open */
579 589 VDEV_STATE_REMOVED, /* Explicitly removed from system */
580 590 VDEV_STATE_CANT_OPEN, /* Tried to open, but failed */
581 591 VDEV_STATE_FAULTED, /* External request to fault device */
582 592 VDEV_STATE_DEGRADED, /* Replicated vdev with unhealthy kids */
583 593 VDEV_STATE_HEALTHY /* Presumed good */
584 594 } vdev_state_t;
585 595
586 596 #define VDEV_STATE_ONLINE VDEV_STATE_HEALTHY
587 597
588 598 /*
589 599 * vdev aux states. When a vdev is in the CANT_OPEN state, the aux field
590 600 * of the vdev stats structure uses these constants to distinguish why.
591 601 */
592 602 typedef enum vdev_aux {
593 603 VDEV_AUX_NONE, /* no error */
594 604 VDEV_AUX_OPEN_FAILED, /* ldi_open_*() or vn_open() failed */
595 605 VDEV_AUX_CORRUPT_DATA, /* bad label or disk contents */
596 606 VDEV_AUX_NO_REPLICAS, /* insufficient number of replicas */
597 607 VDEV_AUX_BAD_GUID_SUM, /* vdev guid sum doesn't match */
598 608 VDEV_AUX_TOO_SMALL, /* vdev size is too small */
599 609 VDEV_AUX_BAD_LABEL, /* the label is OK but invalid */
600 610 VDEV_AUX_VERSION_NEWER, /* on-disk version is too new */
601 611 VDEV_AUX_VERSION_OLDER, /* on-disk version is too old */
602 612 VDEV_AUX_UNSUP_FEAT, /* unsupported features */
603 613 VDEV_AUX_SPARED, /* hot spare used in another pool */
604 614 VDEV_AUX_ERR_EXCEEDED, /* too many errors */
605 615 VDEV_AUX_IO_FAILURE, /* experienced I/O failure */
606 616 VDEV_AUX_BAD_LOG, /* cannot read log chain(s) */
607 617 VDEV_AUX_EXTERNAL, /* external diagnosis */
608 618 VDEV_AUX_SPLIT_POOL /* vdev was split off into another pool */
609 619 } vdev_aux_t;
610 620
611 621 /*
612 622 * pool state. The following states are written to disk as part of the normal
613 623 * SPA lifecycle: ACTIVE, EXPORTED, DESTROYED, SPARE, L2CACHE. The remaining
614 624 * states are software abstractions used at various levels to communicate
615 625 * pool state.
616 626 */
617 627 typedef enum pool_state {
618 628 POOL_STATE_ACTIVE = 0, /* In active use */
619 629 POOL_STATE_EXPORTED, /* Explicitly exported */
620 630 POOL_STATE_DESTROYED, /* Explicitly destroyed */
621 631 POOL_STATE_SPARE, /* Reserved for hot spare use */
622 632 POOL_STATE_L2CACHE, /* Level 2 ARC device */
623 633 POOL_STATE_UNINITIALIZED, /* Internal spa_t state */
624 634 POOL_STATE_UNAVAIL, /* Internal libzfs state */
625 635 POOL_STATE_POTENTIALLY_ACTIVE /* Internal libzfs state */
626 636 } pool_state_t;
627 637
628 638 /*
629 639 * Scan Functions.
630 640 */
631 641 typedef enum pool_scan_func {
632 642 POOL_SCAN_NONE,
633 643 POOL_SCAN_SCRUB,
634 644 POOL_SCAN_RESILVER,
635 645 POOL_SCAN_FUNCS
636 646 } pool_scan_func_t;
637 647
638 648 /*
639 649 * ZIO types. Needed to interpret vdev statistics below.
640 650 */
641 651 typedef enum zio_type {
642 652 ZIO_TYPE_NULL = 0,
643 653 ZIO_TYPE_READ,
644 654 ZIO_TYPE_WRITE,
645 655 ZIO_TYPE_FREE,
646 656 ZIO_TYPE_CLAIM,
647 657 ZIO_TYPE_IOCTL,
648 658 ZIO_TYPES
649 659 } zio_type_t;
650 660
651 661 /*
652 662 * Pool statistics. Note: all fields should be 64-bit because this
653 663 * is passed between kernel and userland as an nvlist uint64 array.
654 664 */
655 665 typedef struct pool_scan_stat {
656 666 /* values stored on disk */
657 667 uint64_t pss_func; /* pool_scan_func_t */
658 668 uint64_t pss_state; /* dsl_scan_state_t */
659 669 uint64_t pss_start_time; /* scan start time */
660 670 uint64_t pss_end_time; /* scan end time */
661 671 uint64_t pss_to_examine; /* total bytes to scan */
662 672 uint64_t pss_examined; /* total examined bytes */
663 673 uint64_t pss_to_process; /* total bytes to process */
664 674 uint64_t pss_processed; /* total processed bytes */
665 675 uint64_t pss_errors; /* scan errors */
666 676
667 677 /* values not stored on disk */
668 678 uint64_t pss_pass_exam; /* examined bytes per scan pass */
669 679 uint64_t pss_pass_start; /* start time of a scan pass */
670 680 } pool_scan_stat_t;
671 681
672 682 typedef enum dsl_scan_state {
673 683 DSS_NONE,
674 684 DSS_SCANNING,
675 685 DSS_FINISHED,
676 686 DSS_CANCELED,
677 687 DSS_NUM_STATES
678 688 } dsl_scan_state_t;
679 689
680 690
681 691 /*
682 692 * Vdev statistics. Note: all fields should be 64-bit because this
683 693 * is passed between kernel and userland as an nvlist uint64 array.
684 694 */
685 695 typedef struct vdev_stat {
686 696 hrtime_t vs_timestamp; /* time since vdev load */
687 697 uint64_t vs_state; /* vdev state */
688 698 uint64_t vs_aux; /* see vdev_aux_t */
689 699 uint64_t vs_alloc; /* space allocated */
690 700 uint64_t vs_space; /* total capacity */
691 701 uint64_t vs_dspace; /* deflated capacity */
692 702 uint64_t vs_rsize; /* replaceable dev size */
693 703 uint64_t vs_esize; /* expandable dev size */
694 704 uint64_t vs_ops[ZIO_TYPES]; /* operation count */
695 705 uint64_t vs_bytes[ZIO_TYPES]; /* bytes read/written */
696 706 uint64_t vs_read_errors; /* read errors */
697 707 uint64_t vs_write_errors; /* write errors */
698 708 uint64_t vs_checksum_errors; /* checksum errors */
699 709 uint64_t vs_self_healed; /* self-healed bytes */
700 710 uint64_t vs_scan_removing; /* removing? */
701 711 uint64_t vs_scan_processed; /* scan processed bytes */
702 712 } vdev_stat_t;
703 713
704 714 /*
705 715 * DDT statistics. Note: all fields should be 64-bit because this
706 716 * is passed between kernel and userland as an nvlist uint64 array.
707 717 */
708 718 typedef struct ddt_object {
709 719 uint64_t ddo_count; /* number of elments in ddt */
710 720 uint64_t ddo_dspace; /* size of ddt on disk */
711 721 uint64_t ddo_mspace; /* size of ddt in-core */
712 722 } ddt_object_t;
713 723
714 724 typedef struct ddt_stat {
715 725 uint64_t dds_blocks; /* blocks */
716 726 uint64_t dds_lsize; /* logical size */
717 727 uint64_t dds_psize; /* physical size */
718 728 uint64_t dds_dsize; /* deflated allocated size */
719 729 uint64_t dds_ref_blocks; /* referenced blocks */
720 730 uint64_t dds_ref_lsize; /* referenced lsize * refcnt */
721 731 uint64_t dds_ref_psize; /* referenced psize * refcnt */
722 732 uint64_t dds_ref_dsize; /* referenced dsize * refcnt */
723 733 } ddt_stat_t;
724 734
725 735 typedef struct ddt_histogram {
726 736 ddt_stat_t ddh_stat[64]; /* power-of-two histogram buckets */
727 737 } ddt_histogram_t;
728 738
729 739 #define ZVOL_DRIVER "zvol"
730 740 #define ZFS_DRIVER "zfs"
731 741 #define ZFS_DEV "/dev/zfs"
732 742
733 743 /* general zvol path */
734 744 #define ZVOL_DIR "/dev/zvol"
735 745 /* expansion */
736 746 #define ZVOL_PSEUDO_DEV "/devices/pseudo/zfs@0:"
↓ open down ↓ |
672 lines elided |
↑ open up ↑ |
737 747 /* for dump and swap */
738 748 #define ZVOL_FULL_DEV_DIR ZVOL_DIR "/dsk/"
739 749 #define ZVOL_FULL_RDEV_DIR ZVOL_DIR "/rdsk/"
740 750
741 751 #define ZVOL_PROP_NAME "name"
742 752 #define ZVOL_DEFAULT_BLOCKSIZE 8192
743 753
744 754 /*
745 755 * /dev/zfs ioctl numbers.
746 756 */
747 -#define ZFS_IOC ('Z' << 8)
748 -
749 757 typedef enum zfs_ioc {
750 - ZFS_IOC_POOL_CREATE = ZFS_IOC,
758 + ZFS_IOC_FIRST = ('Z' << 8),
759 + ZFS_IOC = ZFS_IOC_FIRST,
760 + ZFS_IOC_POOL_CREATE = ZFS_IOC_FIRST,
751 761 ZFS_IOC_POOL_DESTROY,
752 762 ZFS_IOC_POOL_IMPORT,
753 763 ZFS_IOC_POOL_EXPORT,
754 764 ZFS_IOC_POOL_CONFIGS,
755 765 ZFS_IOC_POOL_STATS,
756 766 ZFS_IOC_POOL_TRYIMPORT,
757 767 ZFS_IOC_POOL_SCAN,
758 768 ZFS_IOC_POOL_FREEZE,
759 769 ZFS_IOC_POOL_UPGRADE,
760 770 ZFS_IOC_POOL_GET_HISTORY,
761 771 ZFS_IOC_VDEV_ADD,
762 772 ZFS_IOC_VDEV_REMOVE,
763 773 ZFS_IOC_VDEV_SET_STATE,
764 774 ZFS_IOC_VDEV_ATTACH,
765 775 ZFS_IOC_VDEV_DETACH,
766 776 ZFS_IOC_VDEV_SETPATH,
767 777 ZFS_IOC_VDEV_SETFRU,
768 778 ZFS_IOC_OBJSET_STATS,
769 779 ZFS_IOC_OBJSET_ZPLPROPS,
770 780 ZFS_IOC_DATASET_LIST_NEXT,
771 781 ZFS_IOC_SNAPSHOT_LIST_NEXT,
772 782 ZFS_IOC_SET_PROP,
773 783 ZFS_IOC_CREATE,
774 784 ZFS_IOC_DESTROY,
775 785 ZFS_IOC_ROLLBACK,
776 786 ZFS_IOC_RENAME,
777 787 ZFS_IOC_RECV,
778 788 ZFS_IOC_SEND,
779 789 ZFS_IOC_INJECT_FAULT,
780 790 ZFS_IOC_CLEAR_FAULT,
781 791 ZFS_IOC_INJECT_LIST_NEXT,
782 792 ZFS_IOC_ERROR_LOG,
783 793 ZFS_IOC_CLEAR,
784 794 ZFS_IOC_PROMOTE,
785 795 ZFS_IOC_SNAPSHOT,
786 796 ZFS_IOC_DSOBJ_TO_DSNAME,
787 797 ZFS_IOC_OBJ_TO_PATH,
788 798 ZFS_IOC_POOL_SET_PROPS,
789 799 ZFS_IOC_POOL_GET_PROPS,
790 800 ZFS_IOC_SET_FSACL,
791 801 ZFS_IOC_GET_FSACL,
792 802 ZFS_IOC_SHARE,
793 803 ZFS_IOC_INHERIT_PROP,
794 804 ZFS_IOC_SMB_ACL,
795 805 ZFS_IOC_USERSPACE_ONE,
796 806 ZFS_IOC_USERSPACE_MANY,
797 807 ZFS_IOC_USERSPACE_UPGRADE,
798 808 ZFS_IOC_HOLD,
↓ open down ↓ |
38 lines elided |
↑ open up ↑ |
799 809 ZFS_IOC_RELEASE,
800 810 ZFS_IOC_GET_HOLDS,
801 811 ZFS_IOC_OBJSET_RECVD_PROPS,
802 812 ZFS_IOC_VDEV_SPLIT,
803 813 ZFS_IOC_NEXT_OBJ,
804 814 ZFS_IOC_DIFF,
805 815 ZFS_IOC_TMP_SNAPSHOT,
806 816 ZFS_IOC_OBJ_TO_STATS,
807 817 ZFS_IOC_SPACE_WRITTEN,
808 818 ZFS_IOC_SPACE_SNAPS,
809 - ZFS_IOC_DESTROY_SNAPS_NVL,
819 + ZFS_IOC_DESTROY_SNAPS,
810 820 ZFS_IOC_POOL_REGUID,
811 821 ZFS_IOC_POOL_REOPEN,
812 - ZFS_IOC_SEND_PROGRESS
822 + ZFS_IOC_SEND_PROGRESS,
823 + ZFS_IOC_LOG_HISTORY,
824 + ZFS_IOC_SEND_NEW,
825 + ZFS_IOC_SEND_SPACE,
826 + ZFS_IOC_CLONE,
827 + ZFS_IOC_LAST
813 828 } zfs_ioc_t;
814 829
815 830 /*
816 831 * Internal SPA load state. Used by FMA diagnosis engine.
817 832 */
818 833 typedef enum {
819 834 SPA_LOAD_NONE, /* no load in progress */
820 835 SPA_LOAD_OPEN, /* normal open */
821 836 SPA_LOAD_IMPORT, /* import in progress */
822 837 SPA_LOAD_TRYIMPORT, /* tryimport in progress */
823 838 SPA_LOAD_RECOVER, /* recovery requested */
824 839 SPA_LOAD_ERROR /* load failed */
825 840 } spa_load_state_t;
826 841
827 842 /*
828 843 * Bookmark name values.
829 844 */
830 845 #define ZPOOL_ERR_LIST "error list"
831 846 #define ZPOOL_ERR_DATASET "dataset"
832 847 #define ZPOOL_ERR_OBJECT "object"
833 848
834 849 #define HIS_MAX_RECORD_LEN (MAXPATHLEN + MAXPATHLEN + 1)
835 850
836 851 /*
837 852 * The following are names used in the nvlist describing
838 853 * the pool's history log.
↓ open down ↓ |
16 lines elided |
↑ open up ↑ |
839 854 */
840 855 #define ZPOOL_HIST_RECORD "history record"
841 856 #define ZPOOL_HIST_TIME "history time"
842 857 #define ZPOOL_HIST_CMD "history command"
843 858 #define ZPOOL_HIST_WHO "history who"
844 859 #define ZPOOL_HIST_ZONE "history zone"
845 860 #define ZPOOL_HIST_HOST "history hostname"
846 861 #define ZPOOL_HIST_TXG "history txg"
847 862 #define ZPOOL_HIST_INT_EVENT "history internal event"
848 863 #define ZPOOL_HIST_INT_STR "history internal str"
864 +#define ZPOOL_HIST_INT_NAME "internal_name"
865 +#define ZPOOL_HIST_IOCTL "ioctl"
866 +#define ZPOOL_HIST_INPUT_NVL "in_nvl"
867 +#define ZPOOL_HIST_OUTPUT_NVL "out_nvl"
868 +#define ZPOOL_HIST_DSNAME "dsname"
869 +#define ZPOOL_HIST_DSID "dsid"
849 870
850 871 /*
851 872 * Flags for ZFS_IOC_VDEV_SET_STATE
852 873 */
853 874 #define ZFS_ONLINE_CHECKREMOVE 0x1
854 875 #define ZFS_ONLINE_UNSPARE 0x2
855 876 #define ZFS_ONLINE_FORCEFAULT 0x4
856 877 #define ZFS_ONLINE_EXPAND 0x8
857 878 #define ZFS_OFFLINE_TEMPORARY 0x1
858 879
859 880 /*
860 881 * Flags for ZFS_IOC_POOL_IMPORT
861 882 */
862 883 #define ZFS_IMPORT_NORMAL 0x0
863 884 #define ZFS_IMPORT_VERBATIM 0x1
864 885 #define ZFS_IMPORT_ANY_HOST 0x2
865 886 #define ZFS_IMPORT_MISSING_LOG 0x4
866 887 #define ZFS_IMPORT_ONLY 0x8
867 888
868 889 /*
869 890 * Sysevent payload members. ZFS will generate the following sysevents with the
870 891 * given payloads:
871 892 *
872 893 * ESC_ZFS_RESILVER_START
873 894 * ESC_ZFS_RESILVER_END
874 895 * ESC_ZFS_POOL_DESTROY
875 896 * ESC_ZFS_POOL_REGUID
876 897 *
877 898 * ZFS_EV_POOL_NAME DATA_TYPE_STRING
878 899 * ZFS_EV_POOL_GUID DATA_TYPE_UINT64
879 900 *
880 901 * ESC_ZFS_VDEV_REMOVE
881 902 * ESC_ZFS_VDEV_CLEAR
882 903 * ESC_ZFS_VDEV_CHECK
883 904 *
↓ open down ↓ |
25 lines elided |
↑ open up ↑ |
884 905 * ZFS_EV_POOL_NAME DATA_TYPE_STRING
885 906 * ZFS_EV_POOL_GUID DATA_TYPE_UINT64
886 907 * ZFS_EV_VDEV_PATH DATA_TYPE_STRING (optional)
887 908 * ZFS_EV_VDEV_GUID DATA_TYPE_UINT64
888 909 */
889 910 #define ZFS_EV_POOL_NAME "pool_name"
890 911 #define ZFS_EV_POOL_GUID "pool_guid"
891 912 #define ZFS_EV_VDEV_PATH "vdev_path"
892 913 #define ZFS_EV_VDEV_GUID "vdev_guid"
893 914
894 -/*
895 - * Note: This is encoded on-disk, so new events must be added to the
896 - * end, and unused events can not be removed. Be sure to edit
897 - * libzfs_pool.c: hist_event_table[].
898 - */
899 -typedef enum history_internal_events {
900 - LOG_NO_EVENT = 0,
901 - LOG_POOL_CREATE,
902 - LOG_POOL_VDEV_ADD,
903 - LOG_POOL_REMOVE,
904 - LOG_POOL_DESTROY,
905 - LOG_POOL_EXPORT,
906 - LOG_POOL_IMPORT,
907 - LOG_POOL_VDEV_ATTACH,
908 - LOG_POOL_VDEV_REPLACE,
909 - LOG_POOL_VDEV_DETACH,
910 - LOG_POOL_VDEV_ONLINE,
911 - LOG_POOL_VDEV_OFFLINE,
912 - LOG_POOL_UPGRADE,
913 - LOG_POOL_CLEAR,
914 - LOG_POOL_SCAN,
915 - LOG_POOL_PROPSET,
916 - LOG_DS_CREATE,
917 - LOG_DS_CLONE,
918 - LOG_DS_DESTROY,
919 - LOG_DS_DESTROY_BEGIN,
920 - LOG_DS_INHERIT,
921 - LOG_DS_PROPSET,
922 - LOG_DS_QUOTA,
923 - LOG_DS_PERM_UPDATE,
924 - LOG_DS_PERM_REMOVE,
925 - LOG_DS_PERM_WHO_REMOVE,
926 - LOG_DS_PROMOTE,
927 - LOG_DS_RECEIVE,
928 - LOG_DS_RENAME,
929 - LOG_DS_RESERVATION,
930 - LOG_DS_REPLAY_INC_SYNC,
931 - LOG_DS_REPLAY_FULL_SYNC,
932 - LOG_DS_ROLLBACK,
933 - LOG_DS_SNAPSHOT,
934 - LOG_DS_UPGRADE,
935 - LOG_DS_REFQUOTA,
936 - LOG_DS_REFRESERV,
937 - LOG_POOL_SCAN_DONE,
938 - LOG_DS_USER_HOLD,
939 - LOG_DS_USER_RELEASE,
940 - LOG_POOL_SPLIT,
941 - LOG_END
942 -} history_internal_events_t;
943 -
944 915 #ifdef __cplusplus
945 916 }
946 917 #endif
947 918
948 919 #endif /* _SYS_FS_ZFS_H */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX