rf_dagfuncs.h revision 1.1 1 /* $NetBSD: rf_dagfuncs.h,v 1.1 1998/11/13 04:20:28 oster Exp $ */
2 /*
3 * Copyright (c) 1995 Carnegie-Mellon University.
4 * All rights reserved.
5 *
6 * Author: Mark Holland, William V. Courtright II, Jim Zelenka
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 (at) 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 *
31 * dagfuncs.h -- header file for DAG node execution routines
32 *
33 ****************************************************************************************/
34
35 /*
36 * :
37 * Log: rf_dagfuncs.h,v
38 * Revision 1.17 1996/07/22 19:52:16 jimz
39 * switched node params to RF_DagParam_t, a union of
40 * a 64-bit int and a void *, for better portability
41 * attempted hpux port, but failed partway through for
42 * lack of a single C compiler capable of compiling all
43 * source files
44 *
45 * Revision 1.16 1996/06/10 11:55:47 jimz
46 * Straightened out some per-array/not-per-array distinctions, fixed
47 * a couple bugs related to confusion. Added shutdown lists. Removed
48 * layout shutdown function (now subsumed by shutdown lists).
49 *
50 * Revision 1.15 1996/06/06 17:27:20 jimz
51 * added another read mirror func (partitioning), changed names so dag
52 * creation routines can use the appropriate one
53 *
54 * Revision 1.14 1996/05/30 11:29:41 jimz
55 * Numerous bug fixes. Stripe lock release code disagreed with the taking code
56 * about when stripes should be locked (I made it consistent: no parity, no lock)
57 * There was a lot of extra serialization of I/Os which I've removed- a lot of
58 * it was to calculate values for the cache code, which is no longer with us.
59 * More types, function, macro cleanup. Added code to properly quiesce the array
60 * on shutdown. Made a lot of stuff array-specific which was (bogusly) general
61 * before. Fixed memory allocation, freeing bugs.
62 *
63 * Revision 1.13 1996/05/24 22:17:04 jimz
64 * continue code + namespace cleanup
65 * typed a bunch of flags
66 *
67 * Revision 1.12 1996/05/24 04:28:55 jimz
68 * release cleanup ckpt
69 *
70 * Revision 1.11 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.10 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.9 1995/12/01 15:56:46 root
79 * added copyright info
80 *
81 * Revision 1.8 1995/11/07 16:25:23 wvcii
82 * added DiskUnlockFuncForThreads
83 *
84 */
85
86 #ifndef _RF__RF_DAGFUNCS_H_
87 #define _RF__RF_DAGFUNCS_H_
88
89 int rf_ConfigureDAGFuncs(RF_ShutdownList_t **listp);
90 int rf_TerminateFunc(RF_DagNode_t *node);
91 int rf_TerminateUndoFunc(RF_DagNode_t *node);
92 int rf_DiskReadMirrorIdleFunc(RF_DagNode_t *node);
93 int rf_DiskReadMirrorPartitionFunc(RF_DagNode_t *node);
94 int rf_DiskReadMirrorUndoFunc(RF_DagNode_t *node);
95 int rf_ParityLogUpdateFunc(RF_DagNode_t *node);
96 int rf_ParityLogOverwriteFunc(RF_DagNode_t *node);
97 int rf_ParityLogUpdateUndoFunc(RF_DagNode_t *node);
98 int rf_ParityLogOverwriteUndoFunc(RF_DagNode_t *node);
99 int rf_NullNodeFunc(RF_DagNode_t *node);
100 int rf_NullNodeUndoFunc(RF_DagNode_t *node);
101 int rf_DiskReadFuncForThreads(RF_DagNode_t *node);
102 int rf_DiskWriteFuncForThreads(RF_DagNode_t *node);
103 int rf_DiskUndoFunc(RF_DagNode_t *node);
104 int rf_DiskUnlockFuncForThreads(RF_DagNode_t *node);
105 int rf_GenericWakeupFunc(RF_DagNode_t *node, int status);
106 int rf_RegularXorFunc(RF_DagNode_t *node);
107 int rf_SimpleXorFunc(RF_DagNode_t *node);
108 int rf_RecoveryXorFunc(RF_DagNode_t *node);
109 int rf_XorIntoBuffer(RF_Raid_t *raidPtr, RF_PhysDiskAddr_t *pda, char *srcbuf,
110 char *targbuf, void *bp);
111 int rf_bxor(char *src, char *dest, int len, void *bp);
112 int rf_longword_bxor(register unsigned long *src, register unsigned long *dest,
113 int len, void *bp);
114 int rf_longword_bxor3(register unsigned long *dest, register unsigned long *a,
115 register unsigned long *b, register unsigned long *c, int len, void *bp);
116 int rf_bxor3(unsigned char *dst, unsigned char *a, unsigned char *b,
117 unsigned char *c, unsigned long len, void *bp);
118
119 /* function ptrs defined in ConfigureDAGFuncs() */
120 extern int (*rf_DiskReadFunc)(RF_DagNode_t *);
121 extern int (*rf_DiskWriteFunc)(RF_DagNode_t *);
122 extern int (*rf_DiskReadUndoFunc)(RF_DagNode_t *);
123 extern int (*rf_DiskWriteUndoFunc)(RF_DagNode_t *);
124 extern int (*rf_DiskUnlockFunc)(RF_DagNode_t *);
125 extern int (*rf_DiskUnlockUndoFunc)(RF_DagNode_t *);
126 extern int (*rf_SimpleXorUndoFunc)(RF_DagNode_t *);
127 extern int (*rf_RegularXorUndoFunc)(RF_DagNode_t *);
128 extern int (*rf_RecoveryXorUndoFunc)(RF_DagNode_t *);
129
130 /* macros for manipulating the param[3] in a read or write node */
131 #define RF_CREATE_PARAM3(pri, lk, unlk, wru) (((RF_uint64)(((wru&0xFFFFFF)<<8)|((lk)?0x10:0)|((unlk)?0x20:0)|((pri)&0xF)) ))
132 #define RF_EXTRACT_PRIORITY(_x_) ((((unsigned) ((unsigned long)(_x_))) >> 0) & 0x0F)
133 #define RF_EXTRACT_LOCK_FLAG(_x_) ((((unsigned) ((unsigned long)(_x_))) >> 4) & 0x1)
134 #define RF_EXTRACT_UNLOCK_FLAG(_x_) ((((unsigned) ((unsigned long)(_x_))) >> 5) & 0x1)
135 #define RF_EXTRACT_RU(_x_) ((((unsigned) ((unsigned long)(_x_))) >> 8) & 0xFFFFFF)
136
137 #endif /* !_RF__RF_DAGFUNCS_H_ */
138