2 * Copyright (c) 1997, 1998
3 * Nan Yang Computer Services Limited. All rights reserved.
5 * This software is distributed under the so-called ``Berkeley
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. All advertising materials mentioning features or use of this software
17 * must display the following acknowledgement:
18 * This product includes software developed by Nan Yang Computer
20 * 4. Neither the name of the Company nor the names of its contributors
21 * may be used to endorse or promote products derived from this software
22 * without specific prior written permission.
24 * This software is provided ``as is'', and any express or implied
25 * warranties, including, but not limited to, the implied warranties of
26 * merchantability and fitness for a particular purpose are disclaimed.
27 * In no event shall the company or contributors be liable for any
28 * direct, indirect, incidental, special, exemplary, or consequential
29 * damages (including, but not limited to, procurement of substitute
30 * goods or services; loss of use, data, or profits; or business
31 * interruption) however caused and on any theory of liability, whether
32 * in contract, strict liability, or tort (including negligence or
33 * otherwise) arising in any way out of the use of this software, even if
34 * advised of the possibility of such damage.
38 * This file gets read by makestatetext to create text files
39 * with the names of the states, so don't change the file
43 /* present but unused. Must be 0 */
46 /* mentioned elsewhere but not known to the configuration */
51 * The volume is up and functional, but not all
52 * plexes may be available
56 /* last value, for table dimensions */
57 volume_laststate = volume_up
61 /* An empty entry, not a plex at all. */
64 /* The plex has been referenced by a volume */
68 * The plex has been allocated, but there configuration
74 * A plex which has gone completely down because of
80 * A plex which has been taken down by the
85 /* A plex which is being initialized */
89 * *** The remaining states represent plexes which are
90 * at least partially up. Keep these separate so that
91 * they can be checked more easily.
95 * A plex entry which is at least partially up. Not
96 * all subdisks are available, and an inconsistency
97 * has occurred. If no other plex is uncorrupted,
98 * the volume is no longer consistent.
102 /* first "up" state */
103 plex_firstup = plex_corrupt,
106 * A RAID-5 plex entry which is accessible, but one
107 * subdisk is down, requiring recovery for many
113 * A plex which is really up, but which has a reborn
114 * subdisk which we don't completely trust, and
115 * which we don't want to read if we can avoid it
120 * A plex entry which is completely up. All subdisks
125 /* last value, for table dimensions */
126 plex_laststate = plex_up
133 /* An empty entry, not a subdisk at all. */
137 * A subdisk entry which has not been created
138 * completely. Some fields may be empty.
142 /* The subdisk has been referenced by a plex */
146 * A subdisk entry which has been created completely.
147 * All fields are correct, but the disk hasn't
153 * A subdisk entry which has been created completely.
154 * All fields are correct, and the disk has been
155 * updated, but there is no data on the disk.
160 * A subdisk entry which has been created completely and
161 * which is currently being initialized
166 * A subdisk entry which has been initialized,
167 * but which can't come up because it would
168 * cause inconsistencies.
172 /* *** The following states represent invalid data */
174 * A subdisk entry which has been created completely.
175 * All fields are correct, the config on disk has been
176 * updated, and the data was valid, but since then the
177 * drive has been taken down, and as a result updates
183 * A subdisk entry which has been created completely.
184 * All fields are correct, the disk has been updated,
185 * and the data was valid, but since then the drive
186 * has been crashed and updates have been lost.
190 /* *** The following states represent valid, inaccessible data */
193 * A subdisk entry which has been created completely.
194 * All fields are correct, the disk has been updated,
195 * and the data was valid, but since then the drive
196 * has gone down. No attempt has been made to write
197 * to the subdisk since the crash, so the data is valid.
202 * A subdisk entry which was up, which contained
203 * valid data, and which was taken down by the
204 * administrator. The data is valid.
209 * *** This is invalid data (the subdisk previously had
210 * a numerically lower state), but it is currently in the
211 * process of being revived. We can write but not read.
216 * *** The following states represent accessible subdisks
221 * A subdisk entry which has been created completely.
222 * All fields are correct, the disk has been updated,
223 * and the data was valid, but since then the drive
224 * has gone down and up again. No updates were lost,
225 * but it is possible that the subdisk has been
226 * damaged. We won't read from this subdisk if we
227 * have a choice. If this is the only subdisk which
228 * covers this address space in the plex, we set its
229 * state to sd_up under these circumstances, so this
230 * status implies that there is another subdisk to
231 * fulfil the request.
236 * A subdisk entry which has been created completely.
237 * All fields are correct, the disk has been updated,
238 * and the data is valid.
242 /* last value, for table dimensions */
247 /* present but unused. Must be 0 */
250 /* just mentioned in some other config entry */
259 /* last value, for table dimensions */
260 drive_laststate = drive_up