Home | History | Annotate | Line # | Download | only in raidframe
rf_dagffrd.c revision 1.12
      1  1.12  oster /*	$NetBSD: rf_dagffrd.c,v 1.12 2004/03/05 03:22:05 oster 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.6  lukem 
     36   1.6  lukem #include <sys/cdefs.h>
     37  1.12  oster __KERNEL_RCSID(0, "$NetBSD: rf_dagffrd.c,v 1.12 2004/03/05 03:22:05 oster Exp $");
     38   1.1  oster 
     39   1.5  oster #include <dev/raidframe/raidframevar.h>
     40   1.5  oster 
     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_general.h"
     47   1.1  oster #include "rf_dagffrd.h"
     48   1.1  oster 
     49   1.1  oster /******************************************************************************
     50   1.1  oster  *
     51   1.1  oster  * General comments on DAG creation:
     52   1.3  oster  *
     53   1.1  oster  * All DAGs in this file use roll-away error recovery.  Each DAG has a single
     54   1.1  oster  * commit node, usually called "Cmt."  If an error occurs before the Cmt node
     55   1.1  oster  * is reached, the execution engine will halt forward execution and work
     56   1.1  oster  * backward through the graph, executing the undo functions.  Assuming that
     57   1.1  oster  * each node in the graph prior to the Cmt node are undoable and atomic - or -
     58   1.1  oster  * does not make changes to permanent state, the graph will fail atomically.
     59   1.1  oster  * If an error occurs after the Cmt node executes, the engine will roll-forward
     60   1.1  oster  * through the graph, blindly executing nodes until it reaches the end.
     61   1.1  oster  * If a graph reaches the end, it is assumed to have completed successfully.
     62   1.1  oster  *
     63   1.1  oster  * A graph has only 1 Cmt node.
     64   1.1  oster  *
     65   1.1  oster  */
     66   1.1  oster 
     67   1.1  oster 
     68   1.1  oster /******************************************************************************
     69   1.1  oster  *
     70   1.1  oster  * The following wrappers map the standard DAG creation interface to the
     71   1.1  oster  * DAG creation routines.  Additionally, these wrappers enable experimentation
     72   1.1  oster  * with new DAG structures by providing an extra level of indirection, allowing
     73   1.1  oster  * the DAG creation routines to be replaced at this single point.
     74   1.1  oster  */
     75   1.1  oster 
     76   1.3  oster void
     77  1.10  oster rf_CreateFaultFreeReadDAG(RF_Raid_t *raidPtr, RF_AccessStripeMap_t *asmap,
     78  1.10  oster 			  RF_DagHeader_t *dag_h, void *bp,
     79  1.10  oster 			  RF_RaidAccessFlags_t flags,
     80  1.10  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.10  oster rf_CreateNonredundantDAG(RF_Raid_t *raidPtr, RF_AccessStripeMap_t *asmap,
    128  1.10  oster 			 RF_DagHeader_t *dag_h, void *bp,
    129  1.10  oster 			 RF_RaidAccessFlags_t flags,
    130  1.10  oster 			 RF_AllocListElem_t *allocList,
    131  1.10  oster 			 RF_IoType_t type)
    132   1.1  oster {
    133   1.3  oster 	RF_DagNode_t *nodes, *diskNodes, *blockNode, *commitNode, *termNode;
    134   1.3  oster 	RF_PhysDiskAddr_t *pda = asmap->physInfo;
    135   1.3  oster 	int     (*doFunc) (RF_DagNode_t *), (*undoFunc) (RF_DagNode_t *);
    136   1.3  oster 	int     i, n, totalNumNodes;
    137   1.3  oster 	char   *name;
    138   1.3  oster 
    139   1.3  oster 	n = asmap->numStripeUnitsAccessed;
    140   1.3  oster 	dag_h->creator = "NonredundantDAG";
    141   1.3  oster 
    142   1.3  oster 	RF_ASSERT(RF_IO_IS_R_OR_W(type));
    143   1.3  oster 	switch (type) {
    144   1.3  oster 	case RF_IO_TYPE_READ:
    145   1.3  oster 		doFunc = rf_DiskReadFunc;
    146   1.3  oster 		undoFunc = rf_DiskReadUndoFunc;
    147   1.3  oster 		name = "R  ";
    148  1.12  oster #if RF_DEBUG_DAG
    149   1.3  oster 		if (rf_dagDebug)
    150   1.3  oster 			printf("[Creating non-redundant read DAG]\n");
    151  1.12  oster #endif
    152   1.3  oster 		break;
    153   1.3  oster 	case RF_IO_TYPE_WRITE:
    154   1.3  oster 		doFunc = rf_DiskWriteFunc;
    155   1.3  oster 		undoFunc = rf_DiskWriteUndoFunc;
    156   1.3  oster 		name = "W  ";
    157  1.12  oster #if RF_DEBUG_DAG
    158   1.3  oster 		if (rf_dagDebug)
    159   1.3  oster 			printf("[Creating non-redundant write DAG]\n");
    160  1.12  oster #endif
    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.9  oster 	RF_MallocAndAdd(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.11  oster 		diskNodes[i].params[3].v = RF_CREATE_PARAM3(RF_IO_NORMAL_PRIORITY, 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.10  oster CreateMirrorReadDAG(RF_Raid_t *raidPtr, RF_AccessStripeMap_t *asmap,
    308  1.10  oster 		    RF_DagHeader_t *dag_h, void *bp,
    309  1.10  oster 		    RF_RaidAccessFlags_t flags,
    310  1.10  oster 		    RF_AllocListElem_t *allocList,
    311  1.10  oster 		    int (*readfunc) (RF_DagNode_t * node))
    312   1.1  oster {
    313   1.3  oster 	RF_DagNode_t *readNodes, *nodes, *blockNode, *commitNode, *termNode;
    314   1.3  oster 	RF_PhysDiskAddr_t *data_pda = asmap->physInfo;
    315   1.3  oster 	RF_PhysDiskAddr_t *parity_pda = asmap->parityInfo;
    316   1.3  oster 	int     i, n, totalNumNodes;
    317   1.3  oster 
    318   1.3  oster 	n = asmap->numStripeUnitsAccessed;
    319   1.3  oster 	dag_h->creator = "RaidOneReadDAG";
    320  1.12  oster #if RF_DEBUG_DAG
    321   1.3  oster 	if (rf_dagDebug) {
    322   1.3  oster 		printf("[Creating RAID level 1 read DAG]\n");
    323   1.3  oster 	}
    324  1.12  oster #endif
    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.9  oster 	RF_MallocAndAdd(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.11  oster 		readNodes[i].params[3].v = RF_CREATE_PARAM3(RF_IO_NORMAL_PRIORITY, 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.8  oster #if (RF_INCLUDE_CHAINDECLUSTER > 0) || (RF_INCLUDE_INTERDECLUSTER > 0)
    428   1.8  oster 
    429   1.3  oster void
    430  1.10  oster rf_CreateMirrorPartitionReadDAG(RF_Raid_t *raidPtr,
    431  1.10  oster 				RF_AccessStripeMap_t *asmap,
    432  1.10  oster 				RF_DagHeader_t *dag_h, void *bp,
    433  1.10  oster 				RF_RaidAccessFlags_t flags,
    434  1.10  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   1.8  oster #endif
    440