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 */ 19*ad135b5dSChristopher Siden 20b1b8ab34Slling /* 213f9d6ad7SLin Ling * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. 22*ad135b5dSChristopher Siden * Copyright (c) 2012 by Delphix. All rights reserved. 23b1b8ab34Slling */ 24b1b8ab34Slling 25b1b8ab34Slling #ifndef _SYS_FS_ZFS_H 26b1b8ab34Slling #define _SYS_FS_ZFS_H 27b1b8ab34Slling 28b1b8ab34Slling /* 29b1b8ab34Slling * On-disk version number. 30b1b8ab34Slling */ 31*ad135b5dSChristopher Siden #define SPA_VERSION_INITIAL 1ULL 32*ad135b5dSChristopher Siden #define SPA_VERSION_BEFORE_FEATURES 28ULL 33*ad135b5dSChristopher Siden #define SPA_VERSION 5000ULL 34*ad135b5dSChristopher Siden #define SPA_VERSION_FEATURES 5000ULL 35*ad135b5dSChristopher Siden 36*ad135b5dSChristopher Siden #define SPA_VERSION_IS_SUPPORTED(v) \ 37*ad135b5dSChristopher Siden (((v) >= SPA_VERSION_INITIAL && (v) <= SPA_VERSION_BEFORE_FEATURES) || \ 38*ad135b5dSChristopher Siden ((v) >= SPA_VERSION_FEATURES && (v) <= SPA_VERSION)) 39b1b8ab34Slling 40b1b8ab34Slling /* 41b1b8ab34Slling * The following are configuration names used in the nvlist describing a pool's 42b1b8ab34Slling * configuration. 43b1b8ab34Slling */ 44b1b8ab34Slling #define ZPOOL_CONFIG_VERSION "version" 45b1b8ab34Slling #define ZPOOL_CONFIG_POOL_NAME "name" 46b1b8ab34Slling #define ZPOOL_CONFIG_POOL_STATE "state" 47b1b8ab34Slling #define ZPOOL_CONFIG_POOL_TXG "txg" 48b1b8ab34Slling #define ZPOOL_CONFIG_POOL_GUID "pool_guid" 49b1b8ab34Slling #define ZPOOL_CONFIG_CREATE_TXG "create_txg" 50b1b8ab34Slling #define ZPOOL_CONFIG_TOP_GUID "top_guid" 51b1b8ab34Slling #define ZPOOL_CONFIG_VDEV_TREE "vdev_tree" 52b1b8ab34Slling #define ZPOOL_CONFIG_TYPE "type" 53b1b8ab34Slling #define ZPOOL_CONFIG_CHILDREN "children" 54b1b8ab34Slling #define ZPOOL_CONFIG_ID "id" 55b1b8ab34Slling #define ZPOOL_CONFIG_GUID "guid" 56b1b8ab34Slling #define ZPOOL_CONFIG_PATH "path" 57b1b8ab34Slling #define ZPOOL_CONFIG_DEVID "devid" 58b1b8ab34Slling #define ZPOOL_CONFIG_METASLAB_ARRAY "metaslab_array" 59b1b8ab34Slling #define ZPOOL_CONFIG_METASLAB_SHIFT "metaslab_shift" 60b1b8ab34Slling #define ZPOOL_CONFIG_ASHIFT "ashift" 61b1b8ab34Slling #define ZPOOL_CONFIG_ASIZE "asize" 62b1b8ab34Slling #define ZPOOL_CONFIG_DTL "DTL" 63b1b8ab34Slling #define ZPOOL_CONFIG_STATS "stats" 64b1b8ab34Slling #define ZPOOL_CONFIG_WHOLE_DISK "whole_disk" 65b1b8ab34Slling #define ZPOOL_CONFIG_ERRCOUNT "error_count" 66b1b8ab34Slling #define ZPOOL_CONFIG_NOT_PRESENT "not_present" 67b1b8ab34Slling #define ZPOOL_CONFIG_SPARES "spares" 68b1b8ab34Slling #define ZPOOL_CONFIG_IS_SPARE "is_spare" 69b1b8ab34Slling #define ZPOOL_CONFIG_NPARITY "nparity" 70e7cbe64fSgw #define ZPOOL_CONFIG_PHYS_PATH "phys_path" 71fa94a07fSbrendan #define ZPOOL_CONFIG_L2CACHE "l2cache" 7288ecc943SGeorge Wilson #define ZPOOL_CONFIG_HOLE_ARRAY "hole_array" 7388ecc943SGeorge Wilson #define ZPOOL_CONFIG_VDEV_CHILDREN "vdev_children" 7488ecc943SGeorge Wilson #define ZPOOL_CONFIG_IS_HOLE "is_hole" 759eb19f4dSGeorge Wilson #define ZPOOL_CONFIG_DDT_HISTOGRAM "ddt_histogram" 769eb19f4dSGeorge Wilson #define ZPOOL_CONFIG_DDT_OBJ_STATS "ddt_object_stats" 779eb19f4dSGeorge Wilson #define ZPOOL_CONFIG_DDT_STATS "ddt_stats" 78*ad135b5dSChristopher Siden #define ZPOOL_CONFIG_FEATURES_FOR_READ "features_for_read" 79e7cbe64fSgw /* 80e7cbe64fSgw * The persistent vdev state is stored as separate values rather than a single 81e7cbe64fSgw * 'vdev_state' entry. This is because a device can be in multiple states, such 82e7cbe64fSgw * as offline and degraded. 83e7cbe64fSgw */ 84e7cbe64fSgw #define ZPOOL_CONFIG_OFFLINE "offline" 85e7cbe64fSgw #define ZPOOL_CONFIG_FAULTED "faulted" 86e7cbe64fSgw #define ZPOOL_CONFIG_DEGRADED "degraded" 87e7cbe64fSgw #define ZPOOL_CONFIG_REMOVED "removed" 88b1b8ab34Slling 89b1b8ab34Slling #define VDEV_TYPE_ROOT "root" 90b1b8ab34Slling #define VDEV_TYPE_MIRROR "mirror" 91b1b8ab34Slling #define VDEV_TYPE_REPLACING "replacing" 92b1b8ab34Slling #define VDEV_TYPE_RAIDZ "raidz" 93b1b8ab34Slling #define VDEV_TYPE_DISK "disk" 94b1b8ab34Slling #define VDEV_TYPE_FILE "file" 95b1b8ab34Slling #define VDEV_TYPE_MISSING "missing" 9688ecc943SGeorge Wilson #define VDEV_TYPE_HOLE "hole" 97b1b8ab34Slling #define VDEV_TYPE_SPARE "spare" 98fa94a07fSbrendan #define VDEV_TYPE_L2CACHE "l2cache" 99b1b8ab34Slling 100b1b8ab34Slling /* 101b1b8ab34Slling * pool state. The following states are written to disk as part of the normal 102fa94a07fSbrendan * SPA lifecycle: ACTIVE, EXPORTED, DESTROYED, SPARE, L2CACHE. The remaining 103fa94a07fSbrendan * states are software abstractions used at various levels to communicate pool 104fa94a07fSbrendan * state. 105b1b8ab34Slling */ 106b1b8ab34Slling typedef enum pool_state { 107b1b8ab34Slling POOL_STATE_ACTIVE = 0, /* In active use */ 108b1b8ab34Slling POOL_STATE_EXPORTED, /* Explicitly exported */ 109b1b8ab34Slling POOL_STATE_DESTROYED, /* Explicitly destroyed */ 110b1b8ab34Slling POOL_STATE_SPARE, /* Reserved for hot spare use */ 111fa94a07fSbrendan POOL_STATE_L2CACHE, /* Level 2 ARC device */ 112b1b8ab34Slling POOL_STATE_UNINITIALIZED, /* Internal spa_t state */ 113b1b8ab34Slling POOL_STATE_UNAVAIL, /* Internal libzfs state */ 114b1b8ab34Slling POOL_STATE_POTENTIALLY_ACTIVE /* Internal libzfs state */ 115b1b8ab34Slling } pool_state_t; 116b1b8ab34Slling 117b1b8ab34Slling #endif /* _SYS_FS_ZFS_H */ 118