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