This source file includes following definitions.
- rf_rs_optimal
- rf_rs_degraded
- rf_rs_reconstructing
- rf_rs_reconfigured
- RF_RowStatus_t
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36 #ifndef _RF__RF_RAID_H_
37 #define _RF__RF_RAID_H_
38
39 #include "rf_archs.h"
40 #include "rf_types.h"
41 #include "rf_threadstuff.h"
42
43 #if defined(__NetBSD__)
44 #include "rf_netbsd.h"
45 #elif defined(__OpenBSD__)
46 #include "rf_openbsd.h"
47 #endif
48
49 #include <sys/disklabel.h>
50 #include <sys/types.h>
51
52 #include "rf_alloclist.h"
53 #include "rf_stripelocks.h"
54 #include "rf_layout.h"
55 #include "rf_disks.h"
56 #include "rf_debugMem.h"
57 #include "rf_diskqueue.h"
58 #include "rf_reconstruct.h"
59 #include "rf_acctrace.h"
60
61 #if RF_INCLUDE_PARITYLOGGING > 0
62 #include "rf_paritylog.h"
63 #endif
64
65 #define RF_MAX_DISKS 128
66 #define RF_DEV2RAIDID(_dev) (DISKUNIT(_dev))
67
68 #define RF_COMPONENT_LABEL_VERSION_1 1
69 #define RF_COMPONENT_LABEL_VERSION 2
70 #define RF_RAID_DIRTY 0
71 #define RF_RAID_CLEAN 1
72
73
74
75
76
77 typedef enum RF_RowStatus_e {
78 rf_rs_optimal,
79 rf_rs_degraded,
80 rf_rs_reconstructing,
81 rf_rs_reconfigured
82 } RF_RowStatus_t;
83
84 struct RF_CumulativeStats_s {
85 struct timeval start;
86
87
88
89 struct timeval stop;
90
91
92
93 long sum_io_us;
94
95
96
97 long num_ios;
98
99
100
101 long num_sect_moved;
102
103
104
105 };
106
107 struct RF_ThroughputStats_s {
108 RF_DECLARE_MUTEX (mutex);
109
110
111
112 struct timeval start;
113
114
115
116
117 struct timeval stop;
118
119
120
121
122 RF_uint64 sum_io_us;
123
124
125 RF_uint64 num_ios;
126
127
128
129 long num_out_ios;
130
131
132 };
133
134 struct RF_Raid_s {
135
136
137
138
139
140
141 u_int numRow;
142
143
144
145 u_int numCol;
146
147
148
149 u_int numSpare;
150 int maxQueueDepth;
151 RF_SectorCount_t totalSectors;
152
153
154
155 RF_SectorCount_t sectorsPerDisk;
156
157
158
159
160 u_int logBytesPerSector;
161
162
163
164
165 u_int bytesPerSector;
166
167 RF_int32 sectorMask;
168
169 RF_RaidLayout_t Layout;
170
171
172
173 RF_RaidDisk_t **Disks;
174
175
176
177 RF_DiskQueue_t **Queues;
178
179
180
181 RF_DiskQueueSW_t *qType;
182
183
184
185
186
187
188
189
190
191
192
193
194
195 RF_DECLARE_MUTEX (mutex);
196
197
198
199 RF_RowStatus_t *status;
200
201
202
203 int valid;
204
205
206
207 RF_LockTableEntry_t *lockTable;
208 RF_LockTableEntry_t *quiesceLock;
209 int numFailures;
210
211
212
213 int numNewFailures;
214
215
216
217
218
219
220 int parity_good;
221
222
223
224 int serial_number;
225
226
227
228 int mod_counter;
229
230
231
232 int clean;
233
234
235
236 int openings;
237
238
239
240
241
242
243 int maxOutstanding;
244
245
246
247
248 int autoconfigure;
249
250
251
252
253
254 int root_partition;
255
256
257
258
259 int last_unit;
260
261
262
263
264
265 int config_order;
266
267
268
269
270
271
272
273
274
275
276
277
278
279 RF_ShutdownList_t *shutdownList;
280 RF_AllocListElem_t *cleanupList;
281
282
283
284
285
286
287
288 RF_HeadSepLimit_t headSepLimit;
289 int numFloatingReconBufs;
290 int reconInProgress;
291 RF_DECLARE_COND (waitForReconCond);
292 RF_RaidReconDesc_t *reconDesc;
293 RF_ReconCtrl_t **reconControl;
294
295
296
297
298
299
300
301
302 RF_DECLARE_MUTEX (access_suspend_mutex);
303 RF_DECLARE_COND (quiescent_cond);
304 RF_IoCount_t accesses_suspended;
305 RF_IoCount_t accs_in_flight;
306 int access_suspend_release;
307 int waiting_for_quiescence;
308 RF_CallbackDesc_t *quiesce_wait_list;
309
310
311
312
313 #if !defined(_KERNEL) && !defined(SIMULATE)
314 RF_ThroughputStats_t throughputstats;
315 #endif
316 RF_CumulativeStats_t userstats;
317 int parity_rewrite_stripes_done;
318 int recon_stripes_done;
319 int copyback_stripes_done;
320
321 int recon_in_progress;
322 int parity_rewrite_in_progress;
323 int copyback_in_progress;
324
325
326
327
328 RF_DECLARE_MUTEX (node_queue_mutex);
329 RF_DECLARE_COND (node_queue_cond);
330 RF_DagNode_t *node_queue;
331 RF_Thread_t parity_rewrite_thread;
332 RF_Thread_t copyback_thread;
333 RF_Thread_t engine_thread;
334 RF_Thread_t recon_thread;
335 RF_ThreadGroup_t engine_tg;
336 int shutdown_engine;
337 int dags_in_flight;
338
339
340
341
342 RF_FreeList_t *pss_freelist;
343 long pssTableSize;
344
345
346
347
348 int procsInBufWait;
349 int numFullReconBuffers;
350 RF_AccTraceEntry_t *recon_tracerecs;
351 unsigned long accumXorTimeUs;
352 RF_ReconDoneProc_t *recon_done_procs;
353 RF_DECLARE_MUTEX (recon_done_proc_mutex);
354
355
356
357
358
359
360 RF_DECLARE_COND (outstandingCond);
361 int waitShutdown;
362 int nAccOutstanding;
363
364 RF_DiskId_t **diskids;
365 RF_DiskId_t *sparediskids;
366
367 int raidid;
368 RF_AccTotals_t acc_totals;
369 int keep_acc_totals;
370
371 struct raidcinfo **raid_cinfo;
372
373 int terminate_disk_queues;
374
375
376
377
378
379
380
381
382
383
384 RF_RowCol_t hist_diskreq[RF_MAXROW][RF_MAXCOL];
385
386
387 int noRotate;
388
389 #if RF_INCLUDE_PARITYLOGGING > 0
390
391 RF_SectorCount_t regionLogCapacity;
392 RF_ParityLogQueue_t parityLogPool;
393
394
395 RF_RegionInfo_t *regionInfo;
396 int numParityLogs;
397 int numSectorsPerLog;
398 int regionParityRange;
399 int logsInUse;
400 RF_ParityLogDiskQueue_t parityLogDiskQueue;
401
402
403
404
405 RF_RegionBufferQueue_t regionBufferPool;
406
407
408
409
410 RF_RegionBufferQueue_t parityBufferPool;
411
412
413
414 caddr_t parityLogBufferHeap;
415
416
417
418 RF_Thread_t pLogDiskThreadHandle;
419
420 #endif
421 };
422
423 #endif