xref: /illumos-gate/usr/src/grub/grub-0.97/stage2/zfs-include/zfs.h (revision 9eb19f4d61679ca0382def038665019234458edd)
1b1b8ab34Slling /*
2b1b8ab34Slling  *  GRUB  --  GRand Unified Bootloader
3b1b8ab34Slling  *  Copyright (C) 1999,2000,2001,2002,2003,2004  Free Software Foundation, Inc.
4b1b8ab34Slling  *
5b1b8ab34Slling  *  This program is free software; you can redistribute it and/or modify
6b1b8ab34Slling  *  it under the terms of the GNU General Public License as published by
7b1b8ab34Slling  *  the Free Software Foundation; either version 2 of the License, or
8b1b8ab34Slling  *  (at your option) any later version.
9b1b8ab34Slling  *
10b1b8ab34Slling  *  This program is distributed in the hope that it will be useful,
11b1b8ab34Slling  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12b1b8ab34Slling  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13b1b8ab34Slling  *  GNU General Public License for more details.
14b1b8ab34Slling  *
15b1b8ab34Slling  *  You should have received a copy of the GNU General Public License
16b1b8ab34Slling  *  along with this program; if not, write to the Free Software
17b1b8ab34Slling  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18b1b8ab34Slling  */
19b1b8ab34Slling /*
2014843421SMatthew Ahrens  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
21b1b8ab34Slling  * Use is subject to license terms.
22b1b8ab34Slling  */
23b1b8ab34Slling 
24b1b8ab34Slling #ifndef	_SYS_FS_ZFS_H
25b1b8ab34Slling #define	_SYS_FS_ZFS_H
26b1b8ab34Slling 
27b1b8ab34Slling /*
28b1b8ab34Slling  * On-disk version number.
29b1b8ab34Slling  */
3092241e0bSTom Erickson #define	SPA_VERSION			22ULL
31b1b8ab34Slling 
32b1b8ab34Slling /*
33b1b8ab34Slling  * The following are configuration names used in the nvlist describing a pool's
34b1b8ab34Slling  * configuration.
35b1b8ab34Slling  */
36b1b8ab34Slling #define	ZPOOL_CONFIG_VERSION		"version"
37b1b8ab34Slling #define	ZPOOL_CONFIG_POOL_NAME		"name"
38b1b8ab34Slling #define	ZPOOL_CONFIG_POOL_STATE		"state"
39b1b8ab34Slling #define	ZPOOL_CONFIG_POOL_TXG		"txg"
40b1b8ab34Slling #define	ZPOOL_CONFIG_POOL_GUID		"pool_guid"
41b1b8ab34Slling #define	ZPOOL_CONFIG_CREATE_TXG		"create_txg"
42b1b8ab34Slling #define	ZPOOL_CONFIG_TOP_GUID		"top_guid"
43b1b8ab34Slling #define	ZPOOL_CONFIG_VDEV_TREE		"vdev_tree"
44b1b8ab34Slling #define	ZPOOL_CONFIG_TYPE		"type"
45b1b8ab34Slling #define	ZPOOL_CONFIG_CHILDREN		"children"
46b1b8ab34Slling #define	ZPOOL_CONFIG_ID			"id"
47b1b8ab34Slling #define	ZPOOL_CONFIG_GUID		"guid"
48b1b8ab34Slling #define	ZPOOL_CONFIG_PATH		"path"
49b1b8ab34Slling #define	ZPOOL_CONFIG_DEVID		"devid"
50b1b8ab34Slling #define	ZPOOL_CONFIG_METASLAB_ARRAY	"metaslab_array"
51b1b8ab34Slling #define	ZPOOL_CONFIG_METASLAB_SHIFT	"metaslab_shift"
52b1b8ab34Slling #define	ZPOOL_CONFIG_ASHIFT		"ashift"
53b1b8ab34Slling #define	ZPOOL_CONFIG_ASIZE		"asize"
54b1b8ab34Slling #define	ZPOOL_CONFIG_DTL		"DTL"
55b1b8ab34Slling #define	ZPOOL_CONFIG_STATS		"stats"
56b1b8ab34Slling #define	ZPOOL_CONFIG_WHOLE_DISK		"whole_disk"
57b1b8ab34Slling #define	ZPOOL_CONFIG_ERRCOUNT		"error_count"
58b1b8ab34Slling #define	ZPOOL_CONFIG_NOT_PRESENT	"not_present"
59b1b8ab34Slling #define	ZPOOL_CONFIG_SPARES		"spares"
60b1b8ab34Slling #define	ZPOOL_CONFIG_IS_SPARE		"is_spare"
61b1b8ab34Slling #define	ZPOOL_CONFIG_NPARITY		"nparity"
62e7cbe64fSgw #define	ZPOOL_CONFIG_PHYS_PATH		"phys_path"
63fa94a07fSbrendan #define	ZPOOL_CONFIG_L2CACHE		"l2cache"
6488ecc943SGeorge Wilson #define	ZPOOL_CONFIG_HOLE_ARRAY		"hole_array"
6588ecc943SGeorge Wilson #define	ZPOOL_CONFIG_VDEV_CHILDREN	"vdev_children"
6688ecc943SGeorge Wilson #define	ZPOOL_CONFIG_IS_HOLE		"is_hole"
67*9eb19f4dSGeorge Wilson #define	ZPOOL_CONFIG_DDT_HISTOGRAM	"ddt_histogram"
68*9eb19f4dSGeorge Wilson #define	ZPOOL_CONFIG_DDT_OBJ_STATS	"ddt_object_stats"
69*9eb19f4dSGeorge Wilson #define	ZPOOL_CONFIG_DDT_STATS		"ddt_stats"
70e7cbe64fSgw /*
71e7cbe64fSgw  * The persistent vdev state is stored as separate values rather than a single
72e7cbe64fSgw  * 'vdev_state' entry.  This is because a device can be in multiple states, such
73e7cbe64fSgw  * as offline and degraded.
74e7cbe64fSgw  */
75e7cbe64fSgw #define	ZPOOL_CONFIG_OFFLINE		"offline"
76e7cbe64fSgw #define	ZPOOL_CONFIG_FAULTED		"faulted"
77e7cbe64fSgw #define	ZPOOL_CONFIG_DEGRADED		"degraded"
78e7cbe64fSgw #define	ZPOOL_CONFIG_REMOVED		"removed"
79b1b8ab34Slling 
80b1b8ab34Slling #define	VDEV_TYPE_ROOT			"root"
81b1b8ab34Slling #define	VDEV_TYPE_MIRROR		"mirror"
82b1b8ab34Slling #define	VDEV_TYPE_REPLACING		"replacing"
83b1b8ab34Slling #define	VDEV_TYPE_RAIDZ			"raidz"
84b1b8ab34Slling #define	VDEV_TYPE_DISK			"disk"
85b1b8ab34Slling #define	VDEV_TYPE_FILE			"file"
86b1b8ab34Slling #define	VDEV_TYPE_MISSING		"missing"
8788ecc943SGeorge Wilson #define	VDEV_TYPE_HOLE			"hole"
88b1b8ab34Slling #define	VDEV_TYPE_SPARE			"spare"
89fa94a07fSbrendan #define	VDEV_TYPE_L2CACHE		"l2cache"
90b1b8ab34Slling 
91b1b8ab34Slling /*
92b1b8ab34Slling  * pool state.  The following states are written to disk as part of the normal
93fa94a07fSbrendan  * SPA lifecycle: ACTIVE, EXPORTED, DESTROYED, SPARE, L2CACHE.  The remaining
94fa94a07fSbrendan  * states are software abstractions used at various levels to communicate pool
95fa94a07fSbrendan  * state.
96b1b8ab34Slling  */
97b1b8ab34Slling typedef enum pool_state {
98b1b8ab34Slling 	POOL_STATE_ACTIVE = 0,		/* In active use		*/
99b1b8ab34Slling 	POOL_STATE_EXPORTED,		/* Explicitly exported		*/
100b1b8ab34Slling 	POOL_STATE_DESTROYED,		/* Explicitly destroyed		*/
101b1b8ab34Slling 	POOL_STATE_SPARE,		/* Reserved for hot spare use	*/
102fa94a07fSbrendan 	POOL_STATE_L2CACHE,		/* Level 2 ARC device		*/
103b1b8ab34Slling 	POOL_STATE_UNINITIALIZED,	/* Internal spa_t state		*/
104b1b8ab34Slling 	POOL_STATE_UNAVAIL,		/* Internal libzfs state	*/
105b1b8ab34Slling 	POOL_STATE_POTENTIALLY_ACTIVE	/* Internal libzfs state	*/
106b1b8ab34Slling } pool_state_t;
107b1b8ab34Slling 
108b1b8ab34Slling #endif	/* _SYS_FS_ZFS_H */
109