xref: /netbsd-src/sys/dev/raidframe/rf_raid1.h (revision dc306354b0b29af51801a7632f1e95265a68cd81)
1 /*	$NetBSD: rf_raid1.h,v 1.1 1998/11/13 04:20:33 oster Exp $	*/
2 /*
3  * Copyright (c) 1995 Carnegie-Mellon University.
4  * All rights reserved.
5  *
6  * Author: William V. Courtright II
7  *
8  * Permission to use, copy, modify and distribute this software and
9  * its documentation is hereby granted, provided that both the copyright
10  * notice and this permission notice appear in all copies of the
11  * software, derivative works or modified versions, and any portions
12  * thereof, and that both notices appear in supporting documentation.
13  *
14  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
15  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
16  * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
17  *
18  * Carnegie Mellon requests users of this software to return to
19  *
20  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
21  *  School of Computer Science
22  *  Carnegie Mellon University
23  *  Pittsburgh PA 15213-3890
24  *
25  * any improvements or extensions that they make and grant Carnegie the
26  * rights to redistribute these changes.
27  */
28 
29 /* header file for RAID Level 1 */
30 
31 /*
32  * :
33  * Log: rf_raid1.h,v
34  * Revision 1.17  1996/07/27 23:36:08  jimz
35  * Solaris port of simulator
36  *
37  * Revision 1.16  1996/07/13  00:00:59  jimz
38  * sanitized generalized reconstruction architecture
39  * cleaned up head sep, rbuf problems
40  *
41  * Revision 1.15  1996/07/11  19:08:00  jimz
42  * generalize reconstruction mechanism
43  * allow raid1 reconstructs via copyback (done with array
44  * quiesced, not online, therefore not disk-directed)
45  *
46  * Revision 1.14  1996/06/19  22:23:01  jimz
47  * parity verification is now a layout-configurable thing
48  * not all layouts currently support it (correctly, anyway)
49  *
50  * Revision 1.13  1996/06/10  11:55:47  jimz
51  * Straightened out some per-array/not-per-array distinctions, fixed
52  * a couple bugs related to confusion. Added shutdown lists. Removed
53  * layout shutdown function (now subsumed by shutdown lists).
54  *
55  * Revision 1.12  1996/06/07  22:26:27  jimz
56  * type-ify which_ru (RF_ReconUnitNum_t)
57  *
58  * Revision 1.11  1996/06/07  21:33:04  jimz
59  * begin using consistent types for sector numbers,
60  * stripe numbers, row+col numbers, recon unit numbers
61  *
62  * Revision 1.10  1996/06/03  23:28:26  jimz
63  * more bugfixes
64  * check in tree to sync for IPDS runs with current bugfixes
65  * there still may be a problem with threads in the script test
66  * getting I/Os stuck- not trivially reproducible (runs ~50 times
67  * in a row without getting stuck)
68  *
69  * Revision 1.9  1996/05/31  22:26:54  jimz
70  * fix a lot of mapping problems, memory allocation problems
71  * found some weird lock issues, fixed 'em
72  * more code cleanup
73  *
74  * Revision 1.8  1996/05/27  18:56:37  jimz
75  * more code cleanup
76  * better typing
77  * compiles in all 3 environments
78  *
79  * Revision 1.7  1996/05/24  01:59:45  jimz
80  * another checkpoint in code cleanup for release
81  * time to sync kernel tree
82  *
83  * Revision 1.6  1996/05/18  19:51:34  jimz
84  * major code cleanup- fix syntax, make some types consistent,
85  * add prototypes, clean out dead code, et cetera
86  *
87  * Revision 1.5  1996/05/03  19:35:34  wvcii
88  * moved dags to dag library
89  *
90  * Revision 1.4  1995/11/30  16:07:26  wvcii
91  * added copyright info
92  *
93  * Revision 1.3  1995/11/16  14:56:41  wvcii
94  * updated prototypes
95  *
96  * Revision 1.2  1995/11/07  15:23:01  wvcii
97  * changed RAID1DagSelect prototype
98  * function no longer generates numHdrSucc, numTermAnt
99  *
100  * Revision 1.1  1995/10/04  03:52:59  wvcii
101  * Initial revision
102  *
103  *
104  */
105 
106 #ifndef _RF__RF_RAID1_H_
107 #define _RF__RF_RAID1_H_
108 
109 #include "rf_types.h"
110 
111 int  rf_ConfigureRAID1(RF_ShutdownList_t **listp, RF_Raid_t *raidPtr,
112 	RF_Config_t *cfgPtr);
113 void rf_MapSectorRAID1(RF_Raid_t *raidPtr, RF_RaidAddr_t raidSector,
114 	RF_RowCol_t *row, RF_RowCol_t *col, RF_SectorNum_t *diskSector, int remap);
115 void rf_MapParityRAID1(RF_Raid_t *raidPtr, RF_RaidAddr_t raidSector,
116 	RF_RowCol_t *row, RF_RowCol_t *col, RF_SectorNum_t *diskSector, int remap);
117 void rf_IdentifyStripeRAID1(RF_Raid_t *raidPtr, RF_RaidAddr_t addr,
118 	RF_RowCol_t **diskids, RF_RowCol_t *outRow);
119 void rf_MapSIDToPSIDRAID1(RF_RaidLayout_t *layoutPtr,
120 	RF_StripeNum_t stripeID, RF_StripeNum_t *psID,
121 	RF_ReconUnitNum_t *which_ru);
122 void rf_RAID1DagSelect(RF_Raid_t *raidPtr, RF_IoType_t type,
123 	RF_AccessStripeMap_t *asmap, RF_VoidFuncPtr *createFunc);
124 int rf_VerifyParityRAID1(RF_Raid_t *raidPtr, RF_RaidAddr_t raidAddr,
125 	RF_PhysDiskAddr_t *parityPDA, int correct_it, RF_RaidAccessFlags_t flags);
126 int rf_SubmitReconBufferRAID1(RF_ReconBuffer_t *rbuf, int keep_int,
127 	int use_committed);
128 
129 #endif /* !_RF__RF_RAID1_H_ */
130