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