rf_pq.h revision 1.1 1 /* $NetBSD: rf_pq.h,v 1.1 1998/11/13 04:20:32 oster Exp $ */
2 /*
3 * rf_pq.h
4 */
5 /*
6 * Copyright (c) 1995 Carnegie-Mellon University.
7 * All rights reserved.
8 *
9 * Author: Daniel Stodolsky
10 *
11 * Permission to use, copy, modify and distribute this software and
12 * its documentation is hereby granted, provided that both the copyright
13 * notice and this permission notice appear in all copies of the
14 * software, derivative works or modified versions, and any portions
15 * thereof, and that both notices appear in supporting documentation.
16 *
17 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
18 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
19 * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
20 *
21 * Carnegie Mellon requests users of this software to return to
22 *
23 * Software Distribution Coordinator or Software.Distribution (at) CS.CMU.EDU
24 * School of Computer Science
25 * Carnegie Mellon University
26 * Pittsburgh PA 15213-3890
27 *
28 * any improvements or extensions that they make and grant Carnegie the
29 * rights to redistribute these changes.
30 */
31 /*
32 * :
33 * Log: rf_pq.h,v
34 * Revision 1.9 1996/07/31 15:35:05 jimz
35 * evenodd changes; bugfixes for double-degraded archs, generalize
36 * some formerly PQ-only functions
37 *
38 * Revision 1.8 1996/07/27 23:36:08 jimz
39 * Solaris port of simulator
40 *
41 * Revision 1.7 1996/06/03 23:28:26 jimz
42 * more bugfixes
43 * check in tree to sync for IPDS runs with current bugfixes
44 * there still may be a problem with threads in the script test
45 * getting I/Os stuck- not trivially reproducible (runs ~50 times
46 * in a row without getting stuck)
47 *
48 * Revision 1.6 1996/06/02 17:31:48 jimz
49 * Moved a lot of global stuff into array structure, where it belongs.
50 * Fixed up paritylogging, pss modules in this manner. Some general
51 * code cleanup. Removed lots of dead code, some dead files.
52 *
53 * Revision 1.5 1996/05/31 22:26:54 jimz
54 * fix a lot of mapping problems, memory allocation problems
55 * found some weird lock issues, fixed 'em
56 * more code cleanup
57 *
58 * Revision 1.4 1996/05/27 18:56:37 jimz
59 * more code cleanup
60 * better typing
61 * compiles in all 3 environments
62 *
63 * Revision 1.3 1996/05/24 22:17:04 jimz
64 * continue code + namespace cleanup
65 * typed a bunch of flags
66 *
67 * Revision 1.2 1996/05/23 21:46:35 jimz
68 * checkpoint in code cleanup (release prep)
69 * lots of types, function names have been fixed
70 *
71 * Revision 1.1 1996/05/18 19:56:21 jimz
72 * Initial revision
73 *
74 */
75
76 #ifndef _RF__RF_PQ_H_
77 #define _RF__RF_PQ_H_
78
79 #include "rf_archs.h"
80
81 extern RF_RedFuncs_t rf_pFuncs;
82 extern RF_RedFuncs_t rf_pRecoveryFuncs;
83
84 int rf_RegularONPFunc(RF_DagNode_t *node);
85 int rf_SimpleONPFunc(RF_DagNode_t *node);
86 int rf_RecoveryPFunc(RF_DagNode_t *node);
87 int rf_RegularPFunc(RF_DagNode_t *node);
88
89 #if (RF_INCLUDE_DECL_PQ > 0) || (RF_INCLUDE_RAID6 > 0)
90
91 extern RF_RedFuncs_t rf_qFuncs;
92 extern RF_RedFuncs_t rf_qRecoveryFuncs;
93 extern RF_RedFuncs_t rf_pqRecoveryFuncs;
94
95 void rf_PQDagSelect(RF_Raid_t *raidPtr, RF_IoType_t type,
96 RF_AccessStripeMap_t *asmap, RF_VoidFuncPtr *createFunc);
97 RF_CREATE_DAG_FUNC_DECL(rf_PQCreateLargeWriteDAG);
98 int rf_RegularONQFunc(RF_DagNode_t *node);
99 int rf_SimpleONQFunc(RF_DagNode_t *node);
100 RF_CREATE_DAG_FUNC_DECL(rf_PQCreateSmallWriteDAG);
101 int rf_RegularPQFunc(RF_DagNode_t *node);
102 int rf_RegularQFunc(RF_DagNode_t *node);
103 void rf_Degraded_100_PQFunc(RF_DagNode_t *node);
104 int rf_RecoveryQFunc(RF_DagNode_t *node);
105 int rf_RecoveryPQFunc(RF_DagNode_t *node);
106 void rf_PQ_DegradedWriteQFunc(RF_DagNode_t *node);
107 void rf_IncQ(unsigned long *dest, unsigned long *buf, unsigned length,
108 unsigned coeff);
109 void rf_PQ_recover(unsigned long *pbuf, unsigned long *qbuf, unsigned long *abuf,
110 unsigned long *bbuf, unsigned length, unsigned coeff_a, unsigned coeff_b);
111
112 #endif /* (RF_INCLUDE_DECL_PQ > 0) || (RF_INCLUDE_RAID6 > 0) */
113
114 #endif /* !_RF__RF_PQ_H_ */
115