author | Christopher Siden <chris.siden@delphix.com> |
Mon, 21 May 2012 12:11:39 -0700 | |
changeset 13700 | 2889e2596bd6 |
parent 13049 | 2511753a6599 |
permissions | -rw-r--r-- |
3912 | 1 |
/* |
2 |
* GRUB -- GRand Unified Bootloader |
|
3 |
* Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc. |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or modify |
|
6 |
* it under the terms of the GNU General Public License as published by |
|
7 |
* the Free Software Foundation; either version 2 of the License, or |
|
8 |
* (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
|
18 |
*/ |
|
13700
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13049
diff
changeset
|
19 |
|
3912 | 20 |
/* |
12296
7cf402a7f374
6675946 'zpool status' should show the progress of resilvering for individual disk.
Lin Ling <Lin.Ling@Sun.COM>
parents:
11935
diff
changeset
|
21 |
* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. |
13700
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13049
diff
changeset
|
22 |
* Copyright (c) 2012 by Delphix. All rights reserved. |
3912 | 23 |
*/ |
24 |
||
25 |
#ifndef _SYS_FS_ZFS_H |
|
26 |
#define _SYS_FS_ZFS_H |
|
27 |
||
28 |
/* |
|
29 |
* On-disk version number. |
|
30 |
*/ |
|
13700
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13049
diff
changeset
|
31 |
#define SPA_VERSION_INITIAL 1ULL |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13049
diff
changeset
|
32 |
#define SPA_VERSION_BEFORE_FEATURES 28ULL |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13049
diff
changeset
|
33 |
#define SPA_VERSION 5000ULL |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13049
diff
changeset
|
34 |
#define SPA_VERSION_FEATURES 5000ULL |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13049
diff
changeset
|
35 |
|
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13049
diff
changeset
|
36 |
#define SPA_VERSION_IS_SUPPORTED(v) \ |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13049
diff
changeset
|
37 |
(((v) >= SPA_VERSION_INITIAL && (v) <= SPA_VERSION_BEFORE_FEATURES) || \ |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13049
diff
changeset
|
38 |
((v) >= SPA_VERSION_FEATURES && (v) <= SPA_VERSION)) |
3912 | 39 |
|
40 |
/* |
|
41 |
* The following are configuration names used in the nvlist describing a pool's |
|
42 |
* configuration. |
|
43 |
*/ |
|
44 |
#define ZPOOL_CONFIG_VERSION "version" |
|
45 |
#define ZPOOL_CONFIG_POOL_NAME "name" |
|
46 |
#define ZPOOL_CONFIG_POOL_STATE "state" |
|
47 |
#define ZPOOL_CONFIG_POOL_TXG "txg" |
|
48 |
#define ZPOOL_CONFIG_POOL_GUID "pool_guid" |
|
49 |
#define ZPOOL_CONFIG_CREATE_TXG "create_txg" |
|
50 |
#define ZPOOL_CONFIG_TOP_GUID "top_guid" |
|
51 |
#define ZPOOL_CONFIG_VDEV_TREE "vdev_tree" |
|
52 |
#define ZPOOL_CONFIG_TYPE "type" |
|
53 |
#define ZPOOL_CONFIG_CHILDREN "children" |
|
54 |
#define ZPOOL_CONFIG_ID "id" |
|
55 |
#define ZPOOL_CONFIG_GUID "guid" |
|
56 |
#define ZPOOL_CONFIG_PATH "path" |
|
57 |
#define ZPOOL_CONFIG_DEVID "devid" |
|
58 |
#define ZPOOL_CONFIG_METASLAB_ARRAY "metaslab_array" |
|
59 |
#define ZPOOL_CONFIG_METASLAB_SHIFT "metaslab_shift" |
|
60 |
#define ZPOOL_CONFIG_ASHIFT "ashift" |
|
61 |
#define ZPOOL_CONFIG_ASIZE "asize" |
|
62 |
#define ZPOOL_CONFIG_DTL "DTL" |
|
63 |
#define ZPOOL_CONFIG_STATS "stats" |
|
64 |
#define ZPOOL_CONFIG_WHOLE_DISK "whole_disk" |
|
65 |
#define ZPOOL_CONFIG_ERRCOUNT "error_count" |
|
66 |
#define ZPOOL_CONFIG_NOT_PRESENT "not_present" |
|
67 |
#define ZPOOL_CONFIG_SPARES "spares" |
|
68 |
#define ZPOOL_CONFIG_IS_SPARE "is_spare" |
|
69 |
#define ZPOOL_CONFIG_NPARITY "nparity" |
|
6423 | 70 |
#define ZPOOL_CONFIG_PHYS_PATH "phys_path" |
5450 | 71 |
#define ZPOOL_CONFIG_L2CACHE "l2cache" |
10594
986cb68d2347
6574286 removing a slog doesn't work
George Wilson <George.Wilson@Sun.COM>
parents:
10242
diff
changeset
|
72 |
#define ZPOOL_CONFIG_HOLE_ARRAY "hole_array" |
986cb68d2347
6574286 removing a slog doesn't work
George Wilson <George.Wilson@Sun.COM>
parents:
10242
diff
changeset
|
73 |
#define ZPOOL_CONFIG_VDEV_CHILDREN "vdev_children" |
986cb68d2347
6574286 removing a slog doesn't work
George Wilson <George.Wilson@Sun.COM>
parents:
10242
diff
changeset
|
74 |
#define ZPOOL_CONFIG_IS_HOLE "is_hole" |
11149
8bad7424e2c2
6903731 need userland dedup stats
George Wilson <George.Wilson@Sun.COM>
parents:
11022
diff
changeset
|
75 |
#define ZPOOL_CONFIG_DDT_HISTOGRAM "ddt_histogram" |
8bad7424e2c2
6903731 need userland dedup stats
George Wilson <George.Wilson@Sun.COM>
parents:
11022
diff
changeset
|
76 |
#define ZPOOL_CONFIG_DDT_OBJ_STATS "ddt_object_stats" |
8bad7424e2c2
6903731 need userland dedup stats
George Wilson <George.Wilson@Sun.COM>
parents:
11022
diff
changeset
|
77 |
#define ZPOOL_CONFIG_DDT_STATS "ddt_stats" |
13700
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13049
diff
changeset
|
78 |
#define ZPOOL_CONFIG_FEATURES_FOR_READ "features_for_read" |
6423 | 79 |
/* |
80 |
* The persistent vdev state is stored as separate values rather than a single |
|
81 |
* 'vdev_state' entry. This is because a device can be in multiple states, such |
|
82 |
* as offline and degraded. |
|
83 |
*/ |
|
84 |
#define ZPOOL_CONFIG_OFFLINE "offline" |
|
85 |
#define ZPOOL_CONFIG_FAULTED "faulted" |
|
86 |
#define ZPOOL_CONFIG_DEGRADED "degraded" |
|
87 |
#define ZPOOL_CONFIG_REMOVED "removed" |
|
3912 | 88 |
|
89 |
#define VDEV_TYPE_ROOT "root" |
|
90 |
#define VDEV_TYPE_MIRROR "mirror" |
|
91 |
#define VDEV_TYPE_REPLACING "replacing" |
|
92 |
#define VDEV_TYPE_RAIDZ "raidz" |
|
93 |
#define VDEV_TYPE_DISK "disk" |
|
94 |
#define VDEV_TYPE_FILE "file" |
|
95 |
#define VDEV_TYPE_MISSING "missing" |
|
10594
986cb68d2347
6574286 removing a slog doesn't work
George Wilson <George.Wilson@Sun.COM>
parents:
10242
diff
changeset
|
96 |
#define VDEV_TYPE_HOLE "hole" |
3912 | 97 |
#define VDEV_TYPE_SPARE "spare" |
5450 | 98 |
#define VDEV_TYPE_L2CACHE "l2cache" |
3912 | 99 |
|
100 |
/* |
|
101 |
* pool state. The following states are written to disk as part of the normal |
|
5450 | 102 |
* SPA lifecycle: ACTIVE, EXPORTED, DESTROYED, SPARE, L2CACHE. The remaining |
103 |
* states are software abstractions used at various levels to communicate pool |
|
104 |
* state. |
|
3912 | 105 |
*/ |
106 |
typedef enum pool_state { |
|
107 |
POOL_STATE_ACTIVE = 0, /* In active use */ |
|
108 |
POOL_STATE_EXPORTED, /* Explicitly exported */ |
|
109 |
POOL_STATE_DESTROYED, /* Explicitly destroyed */ |
|
110 |
POOL_STATE_SPARE, /* Reserved for hot spare use */ |
|
5450 | 111 |
POOL_STATE_L2CACHE, /* Level 2 ARC device */ |
3912 | 112 |
POOL_STATE_UNINITIALIZED, /* Internal spa_t state */ |
113 |
POOL_STATE_UNAVAIL, /* Internal libzfs state */ |
|
114 |
POOL_STATE_POTENTIALLY_ACTIVE /* Internal libzfs state */ |
|
115 |
} pool_state_t; |
|
116 |
||
117 |
#endif /* _SYS_FS_ZFS_H */ |