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
37
38 #include "rf_types.h"
39 #include "rf_dagfuncs.h"
40 #include "rf_general.h"
41
42 #ifndef _RF__RF_DAGUTILS_H_
43 #define _RF__RF_DAGUTILS_H_
44
45 struct RF_RedFuncs_s {
46 int (*regular) (RF_DagNode_t *);
47 char *RegularName;
48 int (*simple) (RF_DagNode_t *);
49 char *SimpleName;
50 };
51
52 extern RF_RedFuncs_t rf_xorFuncs;
53 extern RF_RedFuncs_t rf_xorRecoveryFuncs;
54
55 void rf_InitNode(RF_DagNode_t *, RF_NodeStatus_t, int, int (*) (RF_DagNode_t *),
56 int (*) (RF_DagNode_t *), int (*) (RF_DagNode_t *, int), int, int, int,
57 int, RF_DagHeader_t *, char *, RF_AllocListElem_t *);
58
59 void rf_FreeDAG(RF_DagHeader_t *);
60
61 RF_PropHeader_t *rf_MakePropListEntry(RF_DagHeader_t *, int, int,
62 RF_PropHeader_t *, RF_AllocListElem_t *);
63
64 int rf_ConfigureDAGs(RF_ShutdownList_t **);
65
66 RF_DagHeader_t *rf_AllocDAGHeader(void);
67
68 void rf_FreeDAGHeader(RF_DagHeader_t *);
69
70 void *rf_AllocBuffer(RF_Raid_t *, RF_DagHeader_t *, RF_PhysDiskAddr_t *,
71 RF_AllocListElem_t *);
72
73 char *rf_NodeStatusString(RF_DagNode_t *);
74
75 void rf_PrintNodeInfoString(RF_DagNode_t *);
76
77 int rf_AssignNodeNums(RF_DagHeader_t *);
78
79 int rf_RecurAssignNodeNums(RF_DagNode_t *, int, int);
80
81 void rf_ResetDAGHeaderPointers(RF_DagHeader_t *, RF_DagHeader_t *);
82
83 void rf_RecurResetDAGHeaderPointers(RF_DagNode_t *, RF_DagHeader_t *);
84
85 void rf_PrintDAGList(RF_DagHeader_t *);
86
87 int rf_ValidateDAG(RF_DagHeader_t *);
88
89 void rf_redirect_asm(RF_Raid_t *, RF_AccessStripeMap_t *);
90
91 void rf_MapUnaccessedPortionOfStripe(RF_Raid_t *, RF_RaidLayout_t *,
92 RF_AccessStripeMap_t *, RF_DagHeader_t *, RF_AccessStripeMapHeader_t **,
93 int *, char **, char **, RF_AllocListElem_t *);
94
95 int rf_PDAOverlap(RF_RaidLayout_t *, RF_PhysDiskAddr_t *, RF_PhysDiskAddr_t *);
96
97 void rf_GenerateFailedAccessASMs(RF_Raid_t *, RF_AccessStripeMap_t *,
98 RF_PhysDiskAddr_t *, RF_DagHeader_t *, RF_AccessStripeMapHeader_t **,
99 int *, char **, char *, RF_AllocListElem_t *);
100
101
102 #define RF_RESTRICT_NOBUFFER 0
103 #define RF_RESTRICT_DOBUFFER 1
104
105 void rf_RangeRestrictPDA(RF_Raid_t *, RF_PhysDiskAddr_t *, RF_PhysDiskAddr_t *,
106 int, int);
107
108 int rf_compute_workload_shift(RF_Raid_t *, RF_PhysDiskAddr_t *);
109 void rf_SelectMirrorDiskIdle(RF_DagNode_t *);
110 void rf_SelectMirrorDiskPartition(RF_DagNode_t *);
111
112 #endif