xref: /netbsd-src/sys/dev/raidframe/rf_parityscan.h (revision 93f9db1b75d415b78f73ed629beeb86235153473)
1 /*	$NetBSD: rf_parityscan.h,v 1.1 1998/11/13 04:20:32 oster Exp $	*/
2 /*
3  * Copyright (c) 1995 Carnegie-Mellon University.
4  * All rights reserved.
5  *
6  * Author: Mark Holland
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 /* :
30  * Log: rf_parityscan.h,v
31  * Revision 1.14  1996/07/05 18:01:12  jimz
32  * don't make parity protos ndef KERNEL
33  *
34  * Revision 1.13  1996/06/20  17:41:43  jimz
35  * change decl for VerifyParity
36  *
37  * Revision 1.12  1996/06/20  15:38:39  jimz
38  * renumber parityscan return codes
39  *
40  * Revision 1.11  1996/06/19  22:23:01  jimz
41  * parity verification is now a layout-configurable thing
42  * not all layouts currently support it (correctly, anyway)
43  *
44  * Revision 1.10  1996/06/09  02:36:46  jimz
45  * lots of little crufty cleanup- fixup whitespace
46  * issues, comment #ifdefs, improve typing in some
47  * places (esp size-related)
48  *
49  * Revision 1.9  1996/06/07  21:33:04  jimz
50  * begin using consistent types for sector numbers,
51  * stripe numbers, row+col numbers, recon unit numbers
52  *
53  * Revision 1.8  1996/06/02  17:31:48  jimz
54  * Moved a lot of global stuff into array structure, where it belongs.
55  * Fixed up paritylogging, pss modules in this manner. Some general
56  * code cleanup. Removed lots of dead code, some dead files.
57  *
58  * Revision 1.7  1996/05/31  22:26:54  jimz
59  * fix a lot of mapping problems, memory allocation problems
60  * found some weird lock issues, fixed 'em
61  * more code cleanup
62  *
63  * Revision 1.6  1996/05/24  22:17:04  jimz
64  * continue code + namespace cleanup
65  * typed a bunch of flags
66  *
67  * Revision 1.5  1996/05/24  04:28:55  jimz
68  * release cleanup ckpt
69  *
70  * Revision 1.4  1996/05/23  21:46:35  jimz
71  * checkpoint in code cleanup (release prep)
72  * lots of types, function names have been fixed
73  *
74  * Revision 1.3  1996/05/18  19:51:34  jimz
75  * major code cleanup- fix syntax, make some types consistent,
76  * add prototypes, clean out dead code, et cetera
77  *
78  * Revision 1.2  1995/11/30  16:20:46  wvcii
79  * added copyright info
80  *
81  */
82 
83 #ifndef _RF__RF_PARITYSCAN_H_
84 #define _RF__RF_PARITYSCAN_H_
85 
86 #include "rf_types.h"
87 #include "rf_alloclist.h"
88 
89 int rf_RewriteParity(RF_Raid_t *raidPtr);
90 int rf_VerifyParityBasic(RF_Raid_t *raidPtr, RF_RaidAddr_t raidAddr,
91 	RF_PhysDiskAddr_t *parityPDA, int correct_it, RF_RaidAccessFlags_t flags);
92 int rf_VerifyParity(RF_Raid_t *raidPtr, RF_AccessStripeMap_t *stripeMap,
93 	int correct_it, RF_RaidAccessFlags_t flags);
94 int rf_TryToRedirectPDA(RF_Raid_t *raidPtr, RF_PhysDiskAddr_t *pda, int parity);
95 int rf_VerifyDegrModeWrite(RF_Raid_t *raidPtr, RF_AccessStripeMapHeader_t *asmh);
96 RF_DagHeader_t *rf_MakeSimpleDAG(RF_Raid_t *raidPtr, int nNodes,
97 				 int bytesPerSU, char *databuf,
98 				 int (*doFunc)(RF_DagNode_t *),
99 				 int (*undoFunc)(RF_DagNode_t *),
100 				 char *name, RF_AllocListElem_t *alloclist,
101 				 RF_RaidAccessFlags_t flags, int priority);
102 
103 #define RF_DO_CORRECT_PARITY   1
104 #define RF_DONT_CORRECT_PARITY 0
105 
106 /*
107  * Return vals for VerifyParity operation
108  *
109  * Ordering is important here.
110  */
111 #define RF_PARITY_OKAY               0 /* or no parity information */
112 #define RF_PARITY_CORRECTED          1
113 #define RF_PARITY_BAD                2
114 #define RF_PARITY_COULD_NOT_CORRECT  3
115 #define RF_PARITY_COULD_NOT_VERIFY   4
116 
117 #endif /* !_RF__RF_PARITYSCAN_H_ */
118