Home | History | Annotate | Line # | Download | only in raidframe
rf_dagffrd.c revision 1.4.6.1
      1  1.4.6.1  nathanw /*	$NetBSD: rf_dagffrd.c,v 1.4.6.1 2001/10/22 20:41:33 nathanw Exp $	*/
      2      1.1    oster /*
      3      1.1    oster  * Copyright (c) 1995 Carnegie-Mellon University.
      4      1.1    oster  * All rights reserved.
      5      1.1    oster  *
      6      1.1    oster  * Author: Mark Holland, Daniel Stodolsky, William V. Courtright II
      7      1.1    oster  *
      8      1.1    oster  * Permission to use, copy, modify and distribute this software and
      9      1.1    oster  * its documentation is hereby granted, provided that both the copyright
     10      1.1    oster  * notice and this permission notice appear in all copies of the
     11      1.1    oster  * software, derivative works or modified versions, and any portions
     12      1.1    oster  * thereof, and that both notices appear in supporting documentation.
     13      1.1    oster  *
     14      1.1    oster  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
     15      1.1    oster  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
     16      1.1    oster  * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
     17      1.1    oster  *
     18      1.1    oster  * Carnegie Mellon requests users of this software to return to
     19      1.1    oster  *
     20      1.1    oster  *  Software Distribution Coordinator  or  Software.Distribution (at) CS.CMU.EDU
     21      1.1    oster  *  School of Computer Science
     22      1.1    oster  *  Carnegie Mellon University
     23      1.1    oster  *  Pittsburgh PA 15213-3890
     24      1.1    oster  *
     25      1.1    oster  * any improvements or extensions that they make and grant Carnegie the
     26      1.1    oster  * rights to redistribute these changes.
     27      1.1    oster  */
     28      1.1    oster 
     29      1.1    oster /*
     30      1.1    oster  * rf_dagffrd.c
     31      1.1    oster  *
     32      1.1    oster  * code for creating fault-free read DAGs
     33      1.1    oster  *
     34      1.1    oster  */
     35      1.1    oster 
     36  1.4.6.1  nathanw #include <dev/raidframe/raidframevar.h>
     37  1.4.6.1  nathanw 
     38      1.1    oster #include "rf_raid.h"
     39      1.1    oster #include "rf_dag.h"
     40      1.1    oster #include "rf_dagutils.h"
     41      1.1    oster #include "rf_dagfuncs.h"
     42      1.1    oster #include "rf_debugMem.h"
     43      1.1    oster #include "rf_memchunk.h"
     44      1.1    oster #include "rf_general.h"
     45      1.1    oster #include "rf_dagffrd.h"
     46      1.1    oster 
     47      1.1    oster /******************************************************************************
     48      1.1    oster  *
     49      1.1    oster  * General comments on DAG creation:
     50      1.3    oster  *
     51      1.1    oster  * All DAGs in this file use roll-away error recovery.  Each DAG has a single
     52      1.1    oster  * commit node, usually called "Cmt."  If an error occurs before the Cmt node
     53      1.1    oster  * is reached, the execution engine will halt forward execution and work
     54      1.1    oster  * backward through the graph, executing the undo functions.  Assuming that
     55      1.1    oster  * each node in the graph prior to the Cmt node are undoable and atomic - or -
     56      1.1    oster  * does not make changes to permanent state, the graph will fail atomically.
     57      1.1    oster  * If an error occurs after the Cmt node executes, the engine will roll-forward
     58      1.1    oster  * through the graph, blindly executing nodes until it reaches the end.
     59      1.1    oster  * If a graph reaches the end, it is assumed to have completed successfully.
     60      1.1    oster  *
     61      1.1    oster  * A graph has only 1 Cmt node.
     62      1.1    oster  *
     63      1.1    oster  */
     64      1.1    oster 
     65      1.1    oster 
     66      1.1    oster /******************************************************************************
     67      1.1    oster  *
     68      1.1    oster  * The following wrappers map the standard DAG creation interface to the
     69      1.1    oster  * DAG creation routines.  Additionally, these wrappers enable experimentation
     70      1.1    oster  * with new DAG structures by providing an extra level of indirection, allowing
     71      1.1    oster  * the DAG creation routines to be replaced at this single point.
     72      1.1    oster  */
     73      1.1    oster 
     74      1.3    oster void
     75      1.3    oster rf_CreateFaultFreeReadDAG(
     76      1.3    oster     RF_Raid_t * raidPtr,
     77      1.3    oster     RF_AccessStripeMap_t * asmap,
     78      1.3    oster     RF_DagHeader_t * dag_h,
     79      1.3    oster     void *bp,
     80      1.3    oster     RF_RaidAccessFlags_t flags,
     81      1.3    oster     RF_AllocListElem_t * allocList)
     82      1.1    oster {
     83      1.3    oster 	rf_CreateNonredundantDAG(raidPtr, asmap, dag_h, bp, flags, allocList,
     84      1.3    oster 	    RF_IO_TYPE_READ);
     85      1.1    oster }
     86      1.1    oster 
     87      1.1    oster 
     88      1.1    oster /******************************************************************************
     89      1.1    oster  *
     90      1.1    oster  * DAG creation code begins here
     91      1.1    oster  */
     92      1.1    oster 
     93      1.1    oster /******************************************************************************
     94      1.1    oster  *
     95      1.1    oster  * creates a DAG to perform a nonredundant read or write of data within one
     96      1.1    oster  * stripe.
     97      1.1    oster  * For reads, this DAG is as follows:
     98      1.1    oster  *
     99      1.3    oster  *                   /---- read ----\
    100      1.1    oster  *    Header -- Block ---- read ---- Commit -- Terminate
    101      1.1    oster  *                   \---- read ----/
    102      1.1    oster  *
    103      1.1    oster  * For writes, this DAG is as follows:
    104      1.1    oster  *
    105      1.3    oster  *                    /---- write ----\
    106      1.1    oster  *    Header -- Commit ---- write ---- Block -- Terminate
    107      1.1    oster  *                    \---- write ----/
    108      1.1    oster  *
    109      1.1    oster  * There is one disk node per stripe unit accessed, and all disk nodes are in
    110      1.1    oster  * parallel.
    111      1.1    oster  *
    112      1.1    oster  * Tricky point here:  The first disk node (read or write) is created
    113      1.1    oster  * normally.  Subsequent disk nodes are created by copying the first one,
    114      1.1    oster  * and modifying a few params.  The "succedents" and "antecedents" fields are
    115      1.1    oster  * _not_ re-created in each node, but rather left pointing to the same array
    116      1.1    oster  * that was malloc'd when the first node was created.  Thus, it's essential
    117      1.1    oster  * that when this DAG is freed, the succedents and antecedents fields be freed
    118      1.1    oster  * in ONLY ONE of the read nodes.  This does not apply to the "params" field
    119      1.1    oster  * because it is recreated for each READ node.
    120      1.1    oster  *
    121      1.1    oster  * Note that normal-priority accesses do not need to be tagged with their
    122      1.1    oster  * parity stripe ID, because they will never be promoted.  Hence, I've
    123      1.1    oster  * commented-out the code to do this, and marked it with UNNEEDED.
    124      1.1    oster  *
    125      1.1    oster  *****************************************************************************/
    126      1.1    oster 
    127      1.3    oster void
    128      1.3    oster rf_CreateNonredundantDAG(
    129      1.3    oster     RF_Raid_t * raidPtr,
    130      1.3    oster     RF_AccessStripeMap_t * asmap,
    131      1.3    oster     RF_DagHeader_t * dag_h,
    132      1.3    oster     void *bp,
    133      1.3    oster     RF_RaidAccessFlags_t flags,
    134      1.3    oster     RF_AllocListElem_t * allocList,
    135      1.3    oster     RF_IoType_t type)
    136      1.1    oster {
    137      1.3    oster 	RF_DagNode_t *nodes, *diskNodes, *blockNode, *commitNode, *termNode;
    138      1.3    oster 	RF_PhysDiskAddr_t *pda = asmap->physInfo;
    139      1.3    oster 	int     (*doFunc) (RF_DagNode_t *), (*undoFunc) (RF_DagNode_t *);
    140      1.3    oster 	int     i, n, totalNumNodes;
    141      1.3    oster 	char   *name;
    142      1.3    oster 
    143      1.3    oster 	n = asmap->numStripeUnitsAccessed;
    144      1.3    oster 	dag_h->creator = "NonredundantDAG";
    145      1.3    oster 
    146      1.3    oster 	RF_ASSERT(RF_IO_IS_R_OR_W(type));
    147      1.3    oster 	switch (type) {
    148      1.3    oster 	case RF_IO_TYPE_READ:
    149      1.3    oster 		doFunc = rf_DiskReadFunc;
    150      1.3    oster 		undoFunc = rf_DiskReadUndoFunc;
    151      1.3    oster 		name = "R  ";
    152      1.3    oster 		if (rf_dagDebug)
    153      1.3    oster 			printf("[Creating non-redundant read DAG]\n");
    154      1.3    oster 		break;
    155      1.3    oster 	case RF_IO_TYPE_WRITE:
    156      1.3    oster 		doFunc = rf_DiskWriteFunc;
    157      1.3    oster 		undoFunc = rf_DiskWriteUndoFunc;
    158      1.3    oster 		name = "W  ";
    159      1.3    oster 		if (rf_dagDebug)
    160      1.3    oster 			printf("[Creating non-redundant write DAG]\n");
    161      1.3    oster 		break;
    162      1.3    oster 	default:
    163      1.3    oster 		RF_PANIC();
    164      1.3    oster 	}
    165      1.3    oster 
    166      1.3    oster 	/*
    167      1.3    oster          * For reads, the dag can not commit until the block node is reached.
    168      1.3    oster          * for writes, the dag commits immediately.
    169      1.3    oster          */
    170      1.3    oster 	dag_h->numCommitNodes = 1;
    171      1.3    oster 	dag_h->numCommits = 0;
    172      1.3    oster 	dag_h->numSuccedents = 1;
    173      1.3    oster 
    174      1.3    oster 	/*
    175      1.3    oster          * Node count:
    176      1.3    oster          * 1 block node
    177      1.3    oster          * n data reads (or writes)
    178      1.3    oster          * 1 commit node
    179      1.3    oster          * 1 terminator node
    180      1.3    oster          */
    181      1.3    oster 	RF_ASSERT(n > 0);
    182      1.3    oster 	totalNumNodes = n + 3;
    183      1.3    oster 	RF_CallocAndAdd(nodes, totalNumNodes, sizeof(RF_DagNode_t),
    184      1.3    oster 	    (RF_DagNode_t *), allocList);
    185      1.3    oster 	i = 0;
    186      1.3    oster 	diskNodes = &nodes[i];
    187      1.3    oster 	i += n;
    188      1.3    oster 	blockNode = &nodes[i];
    189      1.3    oster 	i += 1;
    190      1.3    oster 	commitNode = &nodes[i];
    191      1.3    oster 	i += 1;
    192      1.3    oster 	termNode = &nodes[i];
    193      1.3    oster 	i += 1;
    194      1.3    oster 	RF_ASSERT(i == totalNumNodes);
    195      1.3    oster 
    196      1.3    oster 	/* initialize nodes */
    197      1.3    oster 	switch (type) {
    198      1.3    oster 	case RF_IO_TYPE_READ:
    199      1.3    oster 		rf_InitNode(blockNode, rf_wait, RF_FALSE, rf_NullNodeFunc, rf_NullNodeUndoFunc,
    200      1.3    oster 		    NULL, n, 0, 0, 0, dag_h, "Nil", allocList);
    201      1.3    oster 		rf_InitNode(commitNode, rf_wait, RF_TRUE, rf_NullNodeFunc, rf_NullNodeUndoFunc,
    202      1.3    oster 		    NULL, 1, n, 0, 0, dag_h, "Cmt", allocList);
    203      1.3    oster 		rf_InitNode(termNode, rf_wait, RF_FALSE, rf_TerminateFunc, rf_TerminateUndoFunc,
    204      1.3    oster 		    NULL, 0, 1, 0, 0, dag_h, "Trm", allocList);
    205      1.3    oster 		break;
    206      1.3    oster 	case RF_IO_TYPE_WRITE:
    207      1.3    oster 		rf_InitNode(blockNode, rf_wait, RF_FALSE, rf_NullNodeFunc, rf_NullNodeUndoFunc,
    208      1.3    oster 		    NULL, 1, 0, 0, 0, dag_h, "Nil", allocList);
    209      1.3    oster 		rf_InitNode(commitNode, rf_wait, RF_TRUE, rf_NullNodeFunc, rf_NullNodeUndoFunc,
    210      1.3    oster 		    NULL, n, 1, 0, 0, dag_h, "Cmt", allocList);
    211      1.3    oster 		rf_InitNode(termNode, rf_wait, RF_FALSE, rf_TerminateFunc, rf_TerminateUndoFunc,
    212      1.3    oster 		    NULL, 0, n, 0, 0, dag_h, "Trm", allocList);
    213      1.3    oster 		break;
    214      1.3    oster 	default:
    215      1.3    oster 		RF_PANIC();
    216      1.3    oster 	}
    217      1.3    oster 
    218      1.3    oster 	for (i = 0; i < n; i++) {
    219      1.3    oster 		RF_ASSERT(pda != NULL);
    220      1.3    oster 		rf_InitNode(&diskNodes[i], rf_wait, RF_FALSE, doFunc, undoFunc, rf_GenericWakeupFunc,
    221      1.3    oster 		    1, 1, 4, 0, dag_h, name, allocList);
    222      1.3    oster 		diskNodes[i].params[0].p = pda;
    223      1.3    oster 		diskNodes[i].params[1].p = pda->bufPtr;
    224      1.3    oster 		/* parity stripe id is not necessary */
    225      1.3    oster 		diskNodes[i].params[2].v = 0;
    226      1.3    oster 		diskNodes[i].params[3].v = RF_CREATE_PARAM3(RF_IO_NORMAL_PRIORITY, 0, 0, 0);
    227      1.3    oster 		pda = pda->next;
    228      1.3    oster 	}
    229      1.3    oster 
    230      1.3    oster 	/*
    231      1.3    oster          * Connect nodes.
    232      1.3    oster          */
    233      1.3    oster 
    234      1.3    oster 	/* connect hdr to block node */
    235      1.3    oster 	RF_ASSERT(blockNode->numAntecedents == 0);
    236      1.3    oster 	dag_h->succedents[0] = blockNode;
    237      1.3    oster 
    238      1.3    oster 	if (type == RF_IO_TYPE_READ) {
    239      1.3    oster 		/* connecting a nonredundant read DAG */
    240      1.3    oster 		RF_ASSERT(blockNode->numSuccedents == n);
    241      1.3    oster 		RF_ASSERT(commitNode->numAntecedents == n);
    242      1.3    oster 		for (i = 0; i < n; i++) {
    243      1.3    oster 			/* connect block node to each read node */
    244      1.3    oster 			RF_ASSERT(diskNodes[i].numAntecedents == 1);
    245      1.3    oster 			blockNode->succedents[i] = &diskNodes[i];
    246      1.3    oster 			diskNodes[i].antecedents[0] = blockNode;
    247      1.3    oster 			diskNodes[i].antType[0] = rf_control;
    248      1.3    oster 
    249      1.3    oster 			/* connect each read node to the commit node */
    250      1.3    oster 			RF_ASSERT(diskNodes[i].numSuccedents == 1);
    251      1.3    oster 			diskNodes[i].succedents[0] = commitNode;
    252      1.3    oster 			commitNode->antecedents[i] = &diskNodes[i];
    253      1.3    oster 			commitNode->antType[i] = rf_control;
    254      1.3    oster 		}
    255      1.3    oster 		/* connect the commit node to the term node */
    256      1.3    oster 		RF_ASSERT(commitNode->numSuccedents == 1);
    257      1.3    oster 		RF_ASSERT(termNode->numAntecedents == 1);
    258      1.3    oster 		RF_ASSERT(termNode->numSuccedents == 0);
    259      1.3    oster 		commitNode->succedents[0] = termNode;
    260      1.3    oster 		termNode->antecedents[0] = commitNode;
    261      1.3    oster 		termNode->antType[0] = rf_control;
    262      1.3    oster 	} else {
    263      1.3    oster 		/* connecting a nonredundant write DAG */
    264      1.3    oster 		/* connect the block node to the commit node */
    265      1.3    oster 		RF_ASSERT(blockNode->numSuccedents == 1);
    266      1.3    oster 		RF_ASSERT(commitNode->numAntecedents == 1);
    267      1.3    oster 		blockNode->succedents[0] = commitNode;
    268      1.3    oster 		commitNode->antecedents[0] = blockNode;
    269      1.3    oster 		commitNode->antType[0] = rf_control;
    270      1.3    oster 
    271      1.3    oster 		RF_ASSERT(commitNode->numSuccedents == n);
    272      1.3    oster 		RF_ASSERT(termNode->numAntecedents == n);
    273      1.3    oster 		RF_ASSERT(termNode->numSuccedents == 0);
    274      1.3    oster 		for (i = 0; i < n; i++) {
    275      1.3    oster 			/* connect the commit node to each write node */
    276      1.3    oster 			RF_ASSERT(diskNodes[i].numAntecedents == 1);
    277      1.3    oster 			commitNode->succedents[i] = &diskNodes[i];
    278      1.3    oster 			diskNodes[i].antecedents[0] = commitNode;
    279      1.3    oster 			diskNodes[i].antType[0] = rf_control;
    280      1.3    oster 
    281      1.3    oster 			/* connect each write node to the term node */
    282      1.3    oster 			RF_ASSERT(diskNodes[i].numSuccedents == 1);
    283      1.3    oster 			diskNodes[i].succedents[0] = termNode;
    284      1.3    oster 			termNode->antecedents[i] = &diskNodes[i];
    285      1.3    oster 			termNode->antType[i] = rf_control;
    286      1.3    oster 		}
    287      1.3    oster 	}
    288      1.1    oster }
    289      1.1    oster /******************************************************************************
    290      1.1    oster  * Create a fault-free read DAG for RAID level 1
    291      1.1    oster  *
    292      1.1    oster  * Hdr -> Nil -> Rmir -> Cmt -> Trm
    293      1.1    oster  *
    294      1.1    oster  * The "Rmir" node schedules a read from the disk in the mirror pair with the
    295      1.1    oster  * shortest disk queue.  the proper queue is selected at Rmir execution.  this
    296      1.1    oster  * deferred mapping is unlike other archs in RAIDframe which generally fix
    297      1.1    oster  * mapping at DAG creation time.
    298      1.1    oster  *
    299      1.1    oster  * Parameters:  raidPtr   - description of the physical array
    300      1.1    oster  *              asmap     - logical & physical addresses for this access
    301      1.1    oster  *              bp        - buffer ptr (for holding read data)
    302      1.3    oster  *              flags     - general flags (e.g. disk locking)
    303      1.1    oster  *              allocList - list of memory allocated in DAG creation
    304      1.1    oster  *****************************************************************************/
    305      1.1    oster 
    306      1.3    oster static void
    307      1.3    oster CreateMirrorReadDAG(
    308      1.3    oster     RF_Raid_t * raidPtr,
    309      1.3    oster     RF_AccessStripeMap_t * asmap,
    310      1.3    oster     RF_DagHeader_t * dag_h,
    311      1.3    oster     void *bp,
    312      1.3    oster     RF_RaidAccessFlags_t flags,
    313      1.3    oster     RF_AllocListElem_t * allocList,
    314      1.3    oster     int (*readfunc) (RF_DagNode_t * node))
    315      1.1    oster {
    316      1.3    oster 	RF_DagNode_t *readNodes, *nodes, *blockNode, *commitNode, *termNode;
    317      1.3    oster 	RF_PhysDiskAddr_t *data_pda = asmap->physInfo;
    318      1.3    oster 	RF_PhysDiskAddr_t *parity_pda = asmap->parityInfo;
    319      1.3    oster 	int     i, n, totalNumNodes;
    320      1.3    oster 
    321      1.3    oster 	n = asmap->numStripeUnitsAccessed;
    322      1.3    oster 	dag_h->creator = "RaidOneReadDAG";
    323      1.3    oster 	if (rf_dagDebug) {
    324      1.3    oster 		printf("[Creating RAID level 1 read DAG]\n");
    325      1.3    oster 	}
    326      1.3    oster 	/*
    327      1.3    oster          * This dag can not commit until the commit node is reached
    328      1.3    oster          * errors prior to the commit point imply the dag has failed.
    329      1.3    oster          */
    330      1.3    oster 	dag_h->numCommitNodes = 1;
    331      1.3    oster 	dag_h->numCommits = 0;
    332      1.3    oster 	dag_h->numSuccedents = 1;
    333      1.3    oster 
    334      1.3    oster 	/*
    335      1.3    oster          * Node count:
    336      1.3    oster          * n data reads
    337      1.3    oster          * 1 block node
    338      1.3    oster          * 1 commit node
    339      1.3    oster          * 1 terminator node
    340      1.3    oster          */
    341      1.3    oster 	RF_ASSERT(n > 0);
    342      1.3    oster 	totalNumNodes = n + 3;
    343      1.3    oster 	RF_CallocAndAdd(nodes, totalNumNodes, sizeof(RF_DagNode_t),
    344      1.3    oster 	    (RF_DagNode_t *), allocList);
    345      1.3    oster 	i = 0;
    346      1.3    oster 	readNodes = &nodes[i];
    347      1.3    oster 	i += n;
    348      1.3    oster 	blockNode = &nodes[i];
    349      1.3    oster 	i += 1;
    350      1.3    oster 	commitNode = &nodes[i];
    351      1.3    oster 	i += 1;
    352      1.3    oster 	termNode = &nodes[i];
    353      1.3    oster 	i += 1;
    354      1.3    oster 	RF_ASSERT(i == totalNumNodes);
    355      1.3    oster 
    356      1.3    oster 	/* initialize nodes */
    357      1.3    oster 	rf_InitNode(blockNode, rf_wait, RF_FALSE, rf_NullNodeFunc,
    358      1.3    oster 	    rf_NullNodeUndoFunc, NULL, n, 0, 0, 0, dag_h, "Nil", allocList);
    359      1.3    oster 	rf_InitNode(commitNode, rf_wait, RF_TRUE, rf_NullNodeFunc,
    360      1.3    oster 	    rf_NullNodeUndoFunc, NULL, 1, n, 0, 0, dag_h, "Cmt", allocList);
    361      1.3    oster 	rf_InitNode(termNode, rf_wait, RF_FALSE, rf_TerminateFunc,
    362      1.3    oster 	    rf_TerminateUndoFunc, NULL, 0, 1, 0, 0, dag_h, "Trm", allocList);
    363      1.3    oster 
    364      1.3    oster 	for (i = 0; i < n; i++) {
    365      1.3    oster 		RF_ASSERT(data_pda != NULL);
    366      1.3    oster 		RF_ASSERT(parity_pda != NULL);
    367      1.3    oster 		rf_InitNode(&readNodes[i], rf_wait, RF_FALSE, readfunc,
    368      1.3    oster 		    rf_DiskReadMirrorUndoFunc, rf_GenericWakeupFunc, 1, 1, 5, 0, dag_h,
    369      1.3    oster 		    "Rmir", allocList);
    370      1.3    oster 		readNodes[i].params[0].p = data_pda;
    371      1.3    oster 		readNodes[i].params[1].p = data_pda->bufPtr;
    372      1.3    oster 		/* parity stripe id is not necessary */
    373      1.3    oster 		readNodes[i].params[2].p = 0;
    374      1.3    oster 		readNodes[i].params[3].v = RF_CREATE_PARAM3(RF_IO_NORMAL_PRIORITY, 0, 0, 0);
    375      1.3    oster 		readNodes[i].params[4].p = parity_pda;
    376      1.3    oster 		data_pda = data_pda->next;
    377      1.3    oster 		parity_pda = parity_pda->next;
    378      1.3    oster 	}
    379      1.3    oster 
    380      1.3    oster 	/*
    381      1.3    oster          * Connect nodes
    382      1.3    oster          */
    383      1.3    oster 
    384      1.3    oster 	/* connect hdr to block node */
    385      1.3    oster 	RF_ASSERT(blockNode->numAntecedents == 0);
    386      1.3    oster 	dag_h->succedents[0] = blockNode;
    387      1.3    oster 
    388      1.3    oster 	/* connect block node to read nodes */
    389      1.3    oster 	RF_ASSERT(blockNode->numSuccedents == n);
    390      1.3    oster 	for (i = 0; i < n; i++) {
    391      1.3    oster 		RF_ASSERT(readNodes[i].numAntecedents == 1);
    392      1.3    oster 		blockNode->succedents[i] = &readNodes[i];
    393      1.3    oster 		readNodes[i].antecedents[0] = blockNode;
    394      1.3    oster 		readNodes[i].antType[0] = rf_control;
    395      1.3    oster 	}
    396      1.3    oster 
    397      1.3    oster 	/* connect read nodes to commit node */
    398      1.3    oster 	RF_ASSERT(commitNode->numAntecedents == n);
    399      1.3    oster 	for (i = 0; i < n; i++) {
    400      1.3    oster 		RF_ASSERT(readNodes[i].numSuccedents == 1);
    401      1.3    oster 		readNodes[i].succedents[0] = commitNode;
    402      1.3    oster 		commitNode->antecedents[i] = &readNodes[i];
    403      1.3    oster 		commitNode->antType[i] = rf_control;
    404      1.3    oster 	}
    405      1.3    oster 
    406      1.3    oster 	/* connect commit node to term node */
    407      1.3    oster 	RF_ASSERT(commitNode->numSuccedents == 1);
    408      1.3    oster 	RF_ASSERT(termNode->numAntecedents == 1);
    409      1.3    oster 	RF_ASSERT(termNode->numSuccedents == 0);
    410      1.3    oster 	commitNode->succedents[0] = termNode;
    411      1.3    oster 	termNode->antecedents[0] = commitNode;
    412      1.3    oster 	termNode->antType[0] = rf_control;
    413      1.1    oster }
    414      1.1    oster 
    415      1.3    oster void
    416      1.3    oster rf_CreateMirrorIdleReadDAG(
    417      1.3    oster     RF_Raid_t * raidPtr,
    418      1.3    oster     RF_AccessStripeMap_t * asmap,
    419      1.3    oster     RF_DagHeader_t * dag_h,
    420      1.3    oster     void *bp,
    421      1.3    oster     RF_RaidAccessFlags_t flags,
    422      1.3    oster     RF_AllocListElem_t * allocList)
    423      1.1    oster {
    424      1.3    oster 	CreateMirrorReadDAG(raidPtr, asmap, dag_h, bp, flags, allocList,
    425      1.3    oster 	    rf_DiskReadMirrorIdleFunc);
    426      1.1    oster }
    427      1.1    oster 
    428      1.3    oster void
    429      1.3    oster rf_CreateMirrorPartitionReadDAG(
    430      1.3    oster     RF_Raid_t * raidPtr,
    431      1.3    oster     RF_AccessStripeMap_t * asmap,
    432      1.3    oster     RF_DagHeader_t * dag_h,
    433      1.3    oster     void *bp,
    434      1.3    oster     RF_RaidAccessFlags_t flags,
    435      1.3    oster     RF_AllocListElem_t * allocList)
    436      1.1    oster {
    437      1.3    oster 	CreateMirrorReadDAG(raidPtr, asmap, dag_h, bp, flags, allocList,
    438      1.3    oster 	    rf_DiskReadMirrorPartitionFunc);
    439      1.1    oster }
    440