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]
23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
37 * Types and constants shared between userland and the kernel.
41 * Each dataset can be one of the following types. These constants can be
42 * combined into masks that can be passed to various functions.
45 ZFS_TYPE_FILESYSTEM = 0x1,
46 ZFS_TYPE_SNAPSHOT = 0x2,
47 ZFS_TYPE_VOLUME = 0x4,
51 #define ZFS_TYPE_DATASET \
52 (ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME | ZFS_TYPE_SNAPSHOT)
54 #define ZAP_MAXNAMELEN 256
55 #define ZAP_MAXVALUELEN (1024 * 8)
56 #define ZAP_OLDMAXVALUELEN 1024
59 * Dataset properties are identified by these constants and must be added to
60 * the end of this list to ensure that external consumers are not affected
61 * by the change. If you make any changes to this list, be sure to update
62 * the property table in usr/src/common/zfs/zfs_prop.c.
70 ZFS_PROP_COMPRESSRATIO,
76 ZFS_PROP_VOLBLOCKSIZE,
91 ZFS_PROP_CREATETXG, /* not exposed to the user */
92 ZFS_PROP_NAME, /* not exposed to the user */
95 ZFS_PROP_ISCSIOPTIONS, /* not exposed to the user */
97 ZFS_PROP_NUMCLONES, /* not exposed to the user */
107 ZFS_PROP_REFRESERVATION,
109 ZFS_PROP_PRIMARYCACHE,
110 ZFS_PROP_SECONDARYCACHE,
114 ZFS_PROP_USEDREFRESERV,
115 ZFS_PROP_USERACCOUNTING, /* not exposed to the user */
116 ZFS_PROP_STMF_SHAREINFO, /* not exposed to the user */
117 ZFS_PROP_DEFER_DESTROY,
127 ZFS_NUM_USERQUOTA_PROPS
128 } zfs_userquota_prop_t;
130 extern const char *zfs_userquota_prop_prefixes[ZFS_NUM_USERQUOTA_PROPS];
133 * Pool properties are identified by these constants and must be added to the
134 * end of this list to ensure that external consumers are not affected
135 * by the change. If you make any changes to this list, be sure to update
136 * the property table in usr/src/common/zfs/zpool_prop.c.
142 ZPOOL_PROP_AVAILABLE,
149 ZPOOL_PROP_DELEGATION,
150 ZPOOL_PROP_AUTOREPLACE,
151 ZPOOL_PROP_CACHEFILE,
152 ZPOOL_PROP_FAILUREMODE,
153 ZPOOL_PROP_LISTSNAPS,
154 ZPOOL_PROP_AUTOEXPAND,
158 #define ZPROP_CONT -2
159 #define ZPROP_INVAL -1
161 #define ZPROP_VALUE "value"
162 #define ZPROP_SOURCE "source"
165 ZPROP_SRC_NONE = 0x1,
166 ZPROP_SRC_DEFAULT = 0x2,
167 ZPROP_SRC_TEMPORARY = 0x4,
168 ZPROP_SRC_LOCAL = 0x8,
169 ZPROP_SRC_INHERITED = 0x10
172 #define ZPROP_SRC_ALL 0x1f
174 typedef int (*zprop_func)(int, void *);
177 * Properties to be set on the root file system of a new pool
178 * are stuffed into their own nvlist, which is then included in
179 * the properties nvlist with the pool properties.
181 #define ZPOOL_ROOTFS_PROPS "root-props-nvl"
184 * Dataset property functions shared between libzfs and kernel.
186 const char *zfs_prop_default_string(zfs_prop_t);
187 uint64_t zfs_prop_default_numeric(zfs_prop_t);
188 boolean_t zfs_prop_readonly(zfs_prop_t);
189 boolean_t zfs_prop_inheritable(zfs_prop_t);
190 boolean_t zfs_prop_setonce(zfs_prop_t);
191 const char *zfs_prop_to_name(zfs_prop_t);
192 zfs_prop_t zfs_name_to_prop(const char *);
193 boolean_t zfs_prop_user(const char *);
194 boolean_t zfs_prop_userquota(const char *name);
195 int zfs_prop_index_to_string(zfs_prop_t, uint64_t, const char **);
196 int zfs_prop_string_to_index(zfs_prop_t, const char *, uint64_t *);
197 boolean_t zfs_prop_valid_for_type(int, zfs_type_t);
200 * Pool property functions shared between libzfs and kernel.
202 zpool_prop_t zpool_name_to_prop(const char *);
203 const char *zpool_prop_to_name(zpool_prop_t);
204 const char *zpool_prop_default_string(zpool_prop_t);
205 uint64_t zpool_prop_default_numeric(zpool_prop_t);
206 boolean_t zpool_prop_readonly(zpool_prop_t);
207 int zpool_prop_index_to_string(zpool_prop_t, uint64_t, const char **);
208 int zpool_prop_string_to_index(zpool_prop_t, const char *, uint64_t *);
211 * Definitions for the Delegation.
214 ZFS_DELEG_WHO_UNKNOWN = 0,
215 ZFS_DELEG_USER = 'u',
216 ZFS_DELEG_USER_SETS = 'U',
217 ZFS_DELEG_GROUP = 'g',
218 ZFS_DELEG_GROUP_SETS = 'G',
219 ZFS_DELEG_EVERYONE = 'e',
220 ZFS_DELEG_EVERYONE_SETS = 'E',
221 ZFS_DELEG_CREATE = 'c',
222 ZFS_DELEG_CREATE_SETS = 'C',
223 ZFS_DELEG_NAMED_SET = 's',
224 ZFS_DELEG_NAMED_SET_SETS = 'S'
225 } zfs_deleg_who_type_t;
229 ZFS_DELEG_PERM_LOCAL = 1,
230 ZFS_DELEG_PERM_DESCENDENT = 2,
231 ZFS_DELEG_PERM_LOCALDESCENDENT = 3,
232 ZFS_DELEG_PERM_CREATE = 4
233 } zfs_deleg_inherit_t;
235 #define ZFS_DELEG_PERM_UID "uid"
236 #define ZFS_DELEG_PERM_GID "gid"
237 #define ZFS_DELEG_PERM_GROUPS "groups"
239 #define ZFS_SMB_ACL_SRC "src"
240 #define ZFS_SMB_ACL_TARGET "target"
243 ZFS_CANMOUNT_OFF = 0,
245 ZFS_CANMOUNT_NOAUTO = 2
246 } zfs_canmount_type_t;
248 typedef enum zfs_share_op {
255 typedef enum zfs_smb_acl_op {
262 typedef enum zfs_cache_type {
264 ZFS_CACHE_METADATA = 1,
270 * On-disk version number.
272 #define SPA_VERSION_1 1ULL
273 #define SPA_VERSION_2 2ULL
274 #define SPA_VERSION_3 3ULL
275 #define SPA_VERSION_4 4ULL
276 #define SPA_VERSION_5 5ULL
277 #define SPA_VERSION_6 6ULL
278 #define SPA_VERSION_7 7ULL
279 #define SPA_VERSION_8 8ULL
280 #define SPA_VERSION_9 9ULL
281 #define SPA_VERSION_10 10ULL
282 #define SPA_VERSION_11 11ULL
283 #define SPA_VERSION_12 12ULL
284 #define SPA_VERSION_13 13ULL
285 #define SPA_VERSION_14 14ULL
286 #define SPA_VERSION_15 15ULL
287 #define SPA_VERSION_16 16ULL
288 #define SPA_VERSION_17 17ULL
289 #define SPA_VERSION_18 18ULL
291 * When bumping up SPA_VERSION, make sure GRUB ZFS understands the on-disk
292 * format change. Go to usr/src/grub/grub-0.97/stage2/{zfs-include/, fsys_zfs*},
293 * and do the appropriate changes. Also bump the version number in
294 * usr/src/grub/capability.
296 #define SPA_VERSION SPA_VERSION_18
297 #define SPA_VERSION_STRING "18"
300 * Symbolic names for the changes that caused a SPA_VERSION switch.
301 * Used in the code when checking for presence or absence of a feature.
302 * Feel free to define multiple symbolic names for each version if there
303 * were multiple changes to on-disk structures during that version.
305 * NOTE: When checking the current SPA_VERSION in your code, be sure
306 * to use spa_version() since it reports the version of the
307 * last synced uberblock. Checking the in-flight version can
308 * be dangerous in some cases.
310 #define SPA_VERSION_INITIAL SPA_VERSION_1
311 #define SPA_VERSION_DITTO_BLOCKS SPA_VERSION_2
312 #define SPA_VERSION_SPARES SPA_VERSION_3
313 #define SPA_VERSION_RAIDZ2 SPA_VERSION_3
314 #define SPA_VERSION_BPLIST_ACCOUNT SPA_VERSION_3
315 #define SPA_VERSION_RAIDZ_DEFLATE SPA_VERSION_3
316 #define SPA_VERSION_DNODE_BYTES SPA_VERSION_3
317 #define SPA_VERSION_ZPOOL_HISTORY SPA_VERSION_4
318 #define SPA_VERSION_GZIP_COMPRESSION SPA_VERSION_5
319 #define SPA_VERSION_BOOTFS SPA_VERSION_6
320 #define SPA_VERSION_SLOGS SPA_VERSION_7
321 #define SPA_VERSION_DELEGATED_PERMS SPA_VERSION_8
322 #define SPA_VERSION_FUID SPA_VERSION_9
323 #define SPA_VERSION_REFRESERVATION SPA_VERSION_9
324 #define SPA_VERSION_REFQUOTA SPA_VERSION_9
325 #define SPA_VERSION_UNIQUE_ACCURATE SPA_VERSION_9
326 #define SPA_VERSION_L2CACHE SPA_VERSION_10
327 #define SPA_VERSION_NEXT_CLONES SPA_VERSION_11
328 #define SPA_VERSION_ORIGIN SPA_VERSION_11
329 #define SPA_VERSION_DSL_SCRUB SPA_VERSION_11
330 #define SPA_VERSION_SNAP_PROPS SPA_VERSION_12
331 #define SPA_VERSION_USED_BREAKDOWN SPA_VERSION_13
332 #define SPA_VERSION_PASSTHROUGH_X SPA_VERSION_14
333 #define SPA_VERSION_USERSPACE SPA_VERSION_15
334 #define SPA_VERSION_STMF_PROP SPA_VERSION_16
335 #define SPA_VERSION_RAIDZ3 SPA_VERSION_17
336 #define SPA_VERSION_USERREFS SPA_VERSION_18
339 * ZPL version - rev'd whenever an incompatible on-disk format change
340 * occurs. This is independent of SPA/DMU/ZAP versioning. You must
341 * also update the version_table[] and help message in zfs_prop.c.
343 * When changing, be sure to teach GRUB how to read the new format!
344 * See usr/src/grub/grub-0.97/stage2/{zfs-include/,fsys_zfs*}
346 #define ZPL_VERSION_1 1ULL
347 #define ZPL_VERSION_2 2ULL
348 #define ZPL_VERSION_3 3ULL
349 #define ZPL_VERSION_4 4ULL
350 #define ZPL_VERSION ZPL_VERSION_4
351 #define ZPL_VERSION_STRING "4"
353 #define ZPL_VERSION_INITIAL ZPL_VERSION_1
354 #define ZPL_VERSION_DIRENT_TYPE ZPL_VERSION_2
355 #define ZPL_VERSION_FUID ZPL_VERSION_3
356 #define ZPL_VERSION_NORMALIZATION ZPL_VERSION_3
357 #define ZPL_VERSION_SYSATTR ZPL_VERSION_3
358 #define ZPL_VERSION_USERSPACE ZPL_VERSION_4
361 * The following are configuration names used in the nvlist describing a pool's
364 #define ZPOOL_CONFIG_VERSION "version"
365 #define ZPOOL_CONFIG_POOL_NAME "name"
366 #define ZPOOL_CONFIG_POOL_STATE "state"
367 #define ZPOOL_CONFIG_POOL_TXG "txg"
368 #define ZPOOL_CONFIG_POOL_GUID "pool_guid"
369 #define ZPOOL_CONFIG_CREATE_TXG "create_txg"
370 #define ZPOOL_CONFIG_TOP_GUID "top_guid"
371 #define ZPOOL_CONFIG_VDEV_TREE "vdev_tree"
372 #define ZPOOL_CONFIG_TYPE "type"
373 #define ZPOOL_CONFIG_CHILDREN "children"
374 #define ZPOOL_CONFIG_ID "id"
375 #define ZPOOL_CONFIG_GUID "guid"
376 #define ZPOOL_CONFIG_PATH "path"
377 #define ZPOOL_CONFIG_DEVID "devid"
378 #define ZPOOL_CONFIG_METASLAB_ARRAY "metaslab_array"
379 #define ZPOOL_CONFIG_METASLAB_SHIFT "metaslab_shift"
380 #define ZPOOL_CONFIG_ASHIFT "ashift"
381 #define ZPOOL_CONFIG_ASIZE "asize"
382 #define ZPOOL_CONFIG_DTL "DTL"
383 #define ZPOOL_CONFIG_STATS "stats"
384 #define ZPOOL_CONFIG_WHOLE_DISK "whole_disk"
385 #define ZPOOL_CONFIG_ERRCOUNT "error_count"
386 #define ZPOOL_CONFIG_NOT_PRESENT "not_present"
387 #define ZPOOL_CONFIG_SPARES "spares"
388 #define ZPOOL_CONFIG_IS_SPARE "is_spare"
389 #define ZPOOL_CONFIG_NPARITY "nparity"
390 #define ZPOOL_CONFIG_HOSTID "hostid"
391 #define ZPOOL_CONFIG_HOSTNAME "hostname"
392 #define ZPOOL_CONFIG_UNSPARE "unspare"
393 #define ZPOOL_CONFIG_PHYS_PATH "phys_path"
394 #define ZPOOL_CONFIG_IS_LOG "is_log"
395 #define ZPOOL_CONFIG_L2CACHE "l2cache"
396 #define ZPOOL_CONFIG_SUSPENDED "suspended" /* not stored on disk */
397 #define ZPOOL_CONFIG_TIMESTAMP "timestamp" /* not stored on disk */
398 #define ZPOOL_CONFIG_BOOTFS "bootfs" /* not stored on disk */
400 * The persistent vdev state is stored as separate values rather than a single
401 * 'vdev_state' entry. This is because a device can be in multiple states, such
402 * as offline and degraded.
404 #define ZPOOL_CONFIG_OFFLINE "offline"
405 #define ZPOOL_CONFIG_FAULTED "faulted"
406 #define ZPOOL_CONFIG_DEGRADED "degraded"
407 #define ZPOOL_CONFIG_REMOVED "removed"
408 #define ZPOOL_CONFIG_FRU "fru"
410 #define VDEV_TYPE_ROOT "root"
411 #define VDEV_TYPE_MIRROR "mirror"
412 #define VDEV_TYPE_REPLACING "replacing"
413 #define VDEV_TYPE_RAIDZ "raidz"
414 #define VDEV_TYPE_DISK "disk"
415 #define VDEV_TYPE_FILE "file"
416 #define VDEV_TYPE_MISSING "missing"
417 #define VDEV_TYPE_SPARE "spare"
418 #define VDEV_TYPE_LOG "log"
419 #define VDEV_TYPE_L2CACHE "l2cache"
422 * This is needed in userland to report the minimum necessary device size.
424 #define SPA_MINDEVSIZE (64ULL << 20)
427 * The location of the pool configuration repository, shared between kernel and
430 #define ZPOOL_CACHE "/etc/zfs/zpool.cache"
433 * vdev states are ordered from least to most healthy.
434 * A vdev that's CANT_OPEN or below is considered unusable.
436 typedef enum vdev_state {
437 VDEV_STATE_UNKNOWN = 0, /* Uninitialized vdev */
438 VDEV_STATE_CLOSED, /* Not currently open */
439 VDEV_STATE_OFFLINE, /* Not allowed to open */
440 VDEV_STATE_REMOVED, /* Explicitly removed from system */
441 VDEV_STATE_CANT_OPEN, /* Tried to open, but failed */
442 VDEV_STATE_FAULTED, /* External request to fault device */
443 VDEV_STATE_DEGRADED, /* Replicated vdev with unhealthy kids */
444 VDEV_STATE_HEALTHY /* Presumed good */
447 #define VDEV_STATE_ONLINE VDEV_STATE_HEALTHY
450 * vdev aux states. When a vdev is in the CANT_OPEN state, the aux field
451 * of the vdev stats structure uses these constants to distinguish why.
453 typedef enum vdev_aux {
454 VDEV_AUX_NONE, /* no error */
455 VDEV_AUX_OPEN_FAILED, /* ldi_open_*() or vn_open() failed */
456 VDEV_AUX_CORRUPT_DATA, /* bad label or disk contents */
457 VDEV_AUX_NO_REPLICAS, /* insufficient number of replicas */
458 VDEV_AUX_BAD_GUID_SUM, /* vdev guid sum doesn't match */
459 VDEV_AUX_TOO_SMALL, /* vdev size is too small */
460 VDEV_AUX_BAD_LABEL, /* the label is OK but invalid */
461 VDEV_AUX_VERSION_NEWER, /* on-disk version is too new */
462 VDEV_AUX_VERSION_OLDER, /* on-disk version is too old */
463 VDEV_AUX_SPARED, /* hot spare used in another pool */
464 VDEV_AUX_ERR_EXCEEDED, /* too many errors */
465 VDEV_AUX_IO_FAILURE, /* experienced I/O failure */
466 VDEV_AUX_BAD_LOG /* cannot read log chain(s) */
470 * pool state. The following states are written to disk as part of the normal
471 * SPA lifecycle: ACTIVE, EXPORTED, DESTROYED, SPARE, L2CACHE. The remaining
472 * states are software abstractions used at various levels to communicate
475 typedef enum pool_state {
476 POOL_STATE_ACTIVE = 0, /* In active use */
477 POOL_STATE_EXPORTED, /* Explicitly exported */
478 POOL_STATE_DESTROYED, /* Explicitly destroyed */
479 POOL_STATE_SPARE, /* Reserved for hot spare use */
480 POOL_STATE_L2CACHE, /* Level 2 ARC device */
481 POOL_STATE_UNINITIALIZED, /* Internal spa_t state */
482 POOL_STATE_UNAVAIL, /* Internal libzfs state */
483 POOL_STATE_POTENTIALLY_ACTIVE /* Internal libzfs state */
489 typedef enum pool_scrub_type {
492 POOL_SCRUB_EVERYTHING,
497 * ZIO types. Needed to interpret vdev statistics below.
499 typedef enum zio_type {
510 * Vdev statistics. Note: all fields should be 64-bit because this
511 * is passed between kernel and userland as an nvlist uint64 array.
513 typedef struct vdev_stat {
514 hrtime_t vs_timestamp; /* time since vdev load */
515 uint64_t vs_state; /* vdev state */
516 uint64_t vs_aux; /* see vdev_aux_t */
517 uint64_t vs_alloc; /* space allocated */
518 uint64_t vs_space; /* total capacity */
519 uint64_t vs_dspace; /* deflated capacity */
520 uint64_t vs_rsize; /* replaceable dev size */
521 uint64_t vs_ops[ZIO_TYPES]; /* operation count */
522 uint64_t vs_bytes[ZIO_TYPES]; /* bytes read/written */
523 uint64_t vs_read_errors; /* read errors */
524 uint64_t vs_write_errors; /* write errors */
525 uint64_t vs_checksum_errors; /* checksum errors */
526 uint64_t vs_self_healed; /* self-healed bytes */
527 uint64_t vs_scrub_type; /* pool_scrub_type_t */
528 uint64_t vs_scrub_complete; /* completed? */
529 uint64_t vs_scrub_examined; /* bytes examined; top */
530 uint64_t vs_scrub_repaired; /* bytes repaired; leaf */
531 uint64_t vs_scrub_errors; /* errors during scrub */
532 uint64_t vs_scrub_start; /* UTC scrub start time */
533 uint64_t vs_scrub_end; /* UTC scrub end time */
536 #define ZVOL_DRIVER "zvol"
537 #define ZFS_DRIVER "zfs"
538 #define ZFS_DEV "/dev/zfs"
541 * zvol paths. Irritatingly, the devfsadm interfaces want all these
542 * paths without the /dev prefix, but for some things, we want the
543 * /dev prefix. Below are the names without /dev.
545 #define ZVOL_DEV_DIR "zvol/dsk"
546 #define ZVOL_RDEV_DIR "zvol/rdsk"
549 * And here are the things we need with /dev, etc. in front of them.
551 #define ZVOL_PSEUDO_DEV "/devices/pseudo/zfs@0:"
552 #define ZVOL_FULL_DEV_DIR "/dev/" ZVOL_DEV_DIR "/"
554 #define ZVOL_PROP_NAME "name"
557 * /dev/zfs ioctl numbers.
559 #define ZFS_IOC ('Z' << 8)
561 typedef enum zfs_ioc {
562 ZFS_IOC_POOL_CREATE = ZFS_IOC,
563 ZFS_IOC_POOL_DESTROY,
566 ZFS_IOC_POOL_CONFIGS,
568 ZFS_IOC_POOL_TRYIMPORT,
571 ZFS_IOC_POOL_UPGRADE,
572 ZFS_IOC_POOL_GET_HISTORY,
575 ZFS_IOC_VDEV_SET_STATE,
578 ZFS_IOC_VDEV_SETPATH,
580 ZFS_IOC_OBJSET_STATS,
581 ZFS_IOC_OBJSET_ZPLPROPS,
582 ZFS_IOC_DATASET_LIST_NEXT,
583 ZFS_IOC_SNAPSHOT_LIST_NEXT,
585 ZFS_IOC_CREATE_MINOR,
586 ZFS_IOC_REMOVE_MINOR,
593 ZFS_IOC_INJECT_FAULT,
595 ZFS_IOC_INJECT_LIST_NEXT,
599 ZFS_IOC_DESTROY_SNAPS,
601 ZFS_IOC_DSOBJ_TO_DSNAME,
603 ZFS_IOC_POOL_SET_PROPS,
604 ZFS_IOC_POOL_GET_PROPS,
607 ZFS_IOC_ISCSI_PERM_CHECK,
609 ZFS_IOC_INHERIT_PROP,
611 ZFS_IOC_USERSPACE_ONE,
612 ZFS_IOC_USERSPACE_MANY,
613 ZFS_IOC_USERSPACE_UPGRADE,
620 * Internal SPA load state. Used by FMA diagnosis engine.
623 SPA_LOAD_NONE, /* no load in progress */
624 SPA_LOAD_OPEN, /* normal open */
625 SPA_LOAD_IMPORT, /* import in progress */
626 SPA_LOAD_TRYIMPORT /* tryimport in progress */
630 * Bookmark name values.
632 #define ZPOOL_ERR_LIST "error list"
633 #define ZPOOL_ERR_DATASET "dataset"
634 #define ZPOOL_ERR_OBJECT "object"
636 #define HIS_MAX_RECORD_LEN (MAXPATHLEN + MAXPATHLEN + 1)
639 * The following are names used in the nvlist describing
640 * the pool's history log.
642 #define ZPOOL_HIST_RECORD "history record"
643 #define ZPOOL_HIST_TIME "history time"
644 #define ZPOOL_HIST_CMD "history command"
645 #define ZPOOL_HIST_WHO "history who"
646 #define ZPOOL_HIST_ZONE "history zone"
647 #define ZPOOL_HIST_HOST "history hostname"
648 #define ZPOOL_HIST_TXG "history txg"
649 #define ZPOOL_HIST_INT_EVENT "history internal event"
650 #define ZPOOL_HIST_INT_STR "history internal str"
653 * Flags for ZFS_IOC_VDEV_SET_STATE
655 #define ZFS_ONLINE_CHECKREMOVE 0x1
656 #define ZFS_ONLINE_UNSPARE 0x2
657 #define ZFS_ONLINE_FORCEFAULT 0x4
658 #define ZFS_ONLINE_EXPAND 0x8
659 #define ZFS_OFFLINE_TEMPORARY 0x1
662 * Sysevent payload members. ZFS will generate the following sysevents with the
665 * ESC_ZFS_RESILVER_START
666 * ESC_ZFS_RESILVER_END
667 * ESC_ZFS_POOL_DESTROY
669 * ZFS_EV_POOL_NAME DATA_TYPE_STRING
670 * ZFS_EV_POOL_GUID DATA_TYPE_UINT64
672 * ESC_ZFS_VDEV_REMOVE
676 * ZFS_EV_POOL_NAME DATA_TYPE_STRING
677 * ZFS_EV_POOL_GUID DATA_TYPE_UINT64
678 * ZFS_EV_VDEV_PATH DATA_TYPE_STRING (optional)
679 * ZFS_EV_VDEV_GUID DATA_TYPE_UINT64
681 #define ZFS_EV_POOL_NAME "pool_name"
682 #define ZFS_EV_POOL_GUID "pool_guid"
683 #define ZFS_EV_VDEV_PATH "vdev_path"
684 #define ZFS_EV_VDEV_GUID "vdev_guid"
687 * Note: This is encoded on-disk, so new events must be added to the
688 * end, and unused events can not be removed. Be sure to edit
689 * zpool_main.c: hist_event_table[].
691 typedef enum history_internal_events {
699 LOG_POOL_VDEV_ATTACH,
700 LOG_POOL_VDEV_REPLACE,
701 LOG_POOL_VDEV_DETACH,
702 LOG_POOL_VDEV_ONLINE,
703 LOG_POOL_VDEV_OFFLINE,
711 LOG_DS_DESTROY_BEGIN,
717 LOG_DS_PERM_WHO_REMOVE,
722 LOG_DS_REPLAY_INC_SYNC,
723 LOG_DS_REPLAY_FULL_SYNC,
733 } history_internal_events_t;
739 #endif /* _SYS_FS_ZFS_H */