Home | History | Annotate | Line # | Download | only in raidframe
rf_dagutils.h revision 1.1
      1  1.1  oster /*	$NetBSD: rf_dagutils.h,v 1.1 1998/11/13 04:20:28 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, 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  *
     31  1.1  oster  * rf_dagutils.h -- header file for utility routines for manipulating DAGs
     32  1.1  oster  *
     33  1.1  oster  *************************************************************************/
     34  1.1  oster 
     35  1.1  oster /*
     36  1.1  oster  * :
     37  1.1  oster  * Log: rf_dagutils.h,v
     38  1.1  oster  * Revision 1.19  1996/07/22 19:52:16  jimz
     39  1.1  oster  * switched node params to RF_DagParam_t, a union of
     40  1.1  oster  * a 64-bit int and a void *, for better portability
     41  1.1  oster  * attempted hpux port, but failed partway through for
     42  1.1  oster  * lack of a single C compiler capable of compiling all
     43  1.1  oster  * source files
     44  1.1  oster  *
     45  1.1  oster  * Revision 1.18  1996/07/15  17:22:18  jimz
     46  1.1  oster  * nit-pick code cleanup
     47  1.1  oster  * resolve stdlib problems on DEC OSF
     48  1.1  oster  *
     49  1.1  oster  * Revision 1.17  1996/06/10  11:55:47  jimz
     50  1.1  oster  * Straightened out some per-array/not-per-array distinctions, fixed
     51  1.1  oster  * a couple bugs related to confusion. Added shutdown lists. Removed
     52  1.1  oster  * layout shutdown function (now subsumed by shutdown lists).
     53  1.1  oster  *
     54  1.1  oster  * Revision 1.16  1996/06/06  17:27:46  jimz
     55  1.1  oster  * added another select mirror func (partitioning), changed names so dag
     56  1.1  oster  * creation routines can use the appropriate one
     57  1.1  oster  *
     58  1.1  oster  * fixed old idle mirror func to pick closest arm if queue lengths are equal
     59  1.1  oster  *
     60  1.1  oster  * Revision 1.15  1996/06/03  23:28:26  jimz
     61  1.1  oster  * more bugfixes
     62  1.1  oster  * check in tree to sync for IPDS runs with current bugfixes
     63  1.1  oster  * there still may be a problem with threads in the script test
     64  1.1  oster  * getting I/Os stuck- not trivially reproducible (runs ~50 times
     65  1.1  oster  * in a row without getting stuck)
     66  1.1  oster  *
     67  1.1  oster  * Revision 1.14  1996/05/27  18:56:37  jimz
     68  1.1  oster  * more code cleanup
     69  1.1  oster  * better typing
     70  1.1  oster  * compiles in all 3 environments
     71  1.1  oster  *
     72  1.1  oster  * Revision 1.13  1996/05/24  22:17:04  jimz
     73  1.1  oster  * continue code + namespace cleanup
     74  1.1  oster  * typed a bunch of flags
     75  1.1  oster  *
     76  1.1  oster  * Revision 1.12  1996/05/24  04:28:55  jimz
     77  1.1  oster  * release cleanup ckpt
     78  1.1  oster  *
     79  1.1  oster  * Revision 1.11  1996/05/23  21:46:35  jimz
     80  1.1  oster  * checkpoint in code cleanup (release prep)
     81  1.1  oster  * lots of types, function names have been fixed
     82  1.1  oster  *
     83  1.1  oster  * Revision 1.10  1996/05/23  00:33:23  jimz
     84  1.1  oster  * code cleanup: move all debug decls to rf_options.c, all extern
     85  1.1  oster  * debug decls to rf_options.h, all debug vars preceded by rf_
     86  1.1  oster  *
     87  1.1  oster  * Revision 1.9  1996/05/18  19:51:34  jimz
     88  1.1  oster  * major code cleanup- fix syntax, make some types consistent,
     89  1.1  oster  * add prototypes, clean out dead code, et cetera
     90  1.1  oster  *
     91  1.1  oster  * Revision 1.8  1996/05/08  21:01:24  jimz
     92  1.1  oster  * fixed up enum type names that were conflicting with other
     93  1.1  oster  * enums and function names (ie, "panic")
     94  1.1  oster  * future naming trends will be towards RF_ and rf_ for
     95  1.1  oster  * everything raidframe-related
     96  1.1  oster  *
     97  1.1  oster  * Revision 1.7  1996/05/03  19:55:27  wvcii
     98  1.1  oster  * added misc routines from old dag creation files
     99  1.1  oster  *
    100  1.1  oster  * Revision 1.6  1995/12/01  15:57:28  root
    101  1.1  oster  * added copyright info
    102  1.1  oster  *
    103  1.1  oster  * Revision 1.5  1995/11/07  16:21:36  wvcii
    104  1.1  oster  * modified InitNode and InitNodeFromBuf prototypes
    105  1.1  oster  *
    106  1.1  oster  */
    107  1.1  oster 
    108  1.1  oster #include "rf_types.h"
    109  1.1  oster #include "rf_dagfuncs.h"
    110  1.1  oster #include "rf_general.h"
    111  1.1  oster 
    112  1.1  oster #ifndef _RF__RF_DAGUTILS_H_
    113  1.1  oster #define _RF__RF_DAGUTILS_H_
    114  1.1  oster 
    115  1.1  oster struct RF_RedFuncs_s {
    116  1.1  oster   int   (*regular)(RF_DagNode_t *);
    117  1.1  oster   char   *RegularName;
    118  1.1  oster   int   (*simple)(RF_DagNode_t *);
    119  1.1  oster   char   *SimpleName;
    120  1.1  oster };
    121  1.1  oster 
    122  1.1  oster extern RF_RedFuncs_t rf_xorFuncs;
    123  1.1  oster extern RF_RedFuncs_t rf_xorRecoveryFuncs;
    124  1.1  oster 
    125  1.1  oster void rf_InitNode(RF_DagNode_t *node, RF_NodeStatus_t initstatus,
    126  1.1  oster 	      int commit,
    127  1.1  oster 	      int (*doFunc)(RF_DagNode_t *node),
    128  1.1  oster 	      int (*undoFunc)(RF_DagNode_t *node),
    129  1.1  oster 	      int (*wakeFunc)(RF_DagNode_t *node, int status),
    130  1.1  oster 	      int nSucc, int nAnte, int nParam, int nResult,
    131  1.1  oster 	      RF_DagHeader_t *hdr, char *name, RF_AllocListElem_t *alist);
    132  1.1  oster 
    133  1.1  oster void rf_FreeDAG(RF_DagHeader_t *dag_h);
    134  1.1  oster 
    135  1.1  oster RF_PropHeader_t *rf_MakePropListEntry(RF_DagHeader_t *dag_h, int resultNum,
    136  1.1  oster 	int paramNum, RF_PropHeader_t *next, RF_AllocListElem_t *allocList);
    137  1.1  oster 
    138  1.1  oster int rf_ConfigureDAGs(RF_ShutdownList_t **listp);
    139  1.1  oster 
    140  1.1  oster RF_DagHeader_t *rf_AllocDAGHeader(void);
    141  1.1  oster 
    142  1.1  oster void rf_FreeDAGHeader(RF_DagHeader_t *dh);
    143  1.1  oster 
    144  1.1  oster void *rf_AllocBuffer(RF_Raid_t *raidPtr, RF_DagHeader_t *dag_h,
    145  1.1  oster 	RF_PhysDiskAddr_t *pda, RF_AllocListElem_t *allocList);
    146  1.1  oster 
    147  1.1  oster char *rf_NodeStatusString(RF_DagNode_t *node);
    148  1.1  oster 
    149  1.1  oster void rf_PrintNodeInfoString(RF_DagNode_t *node);
    150  1.1  oster 
    151  1.1  oster int rf_AssignNodeNums(RF_DagHeader_t *dag_h);
    152  1.1  oster 
    153  1.1  oster int rf_RecurAssignNodeNums(RF_DagNode_t *node, int num, int unvisited);
    154  1.1  oster 
    155  1.1  oster void rf_ResetDAGHeaderPointers(RF_DagHeader_t *dag_h, RF_DagHeader_t *newptr);
    156  1.1  oster 
    157  1.1  oster void rf_RecurResetDAGHeaderPointers(RF_DagNode_t *node, RF_DagHeader_t *newptr);
    158  1.1  oster 
    159  1.1  oster void rf_PrintDAGList(RF_DagHeader_t *dag_h);
    160  1.1  oster 
    161  1.1  oster int rf_ValidateDAG(RF_DagHeader_t *dag_h);
    162  1.1  oster 
    163  1.1  oster void rf_redirect_asm(RF_Raid_t *raidPtr, RF_AccessStripeMap_t *asmap);
    164  1.1  oster 
    165  1.1  oster void rf_MapUnaccessedPortionOfStripe(RF_Raid_t *raidPtr,
    166  1.1  oster 	RF_RaidLayout_t *layoutPtr,
    167  1.1  oster 	RF_AccessStripeMap_t *asmap, RF_DagHeader_t *dag_h,
    168  1.1  oster 	RF_AccessStripeMapHeader_t **new_asm_h, int *nRodNodes, char **sosBuffer,
    169  1.1  oster 	char **eosBuffer, RF_AllocListElem_t *allocList);
    170  1.1  oster 
    171  1.1  oster int rf_PDAOverlap(RF_RaidLayout_t *layoutPtr, RF_PhysDiskAddr_t *src,
    172  1.1  oster 	RF_PhysDiskAddr_t *dest);
    173  1.1  oster 
    174  1.1  oster void rf_GenerateFailedAccessASMs(RF_Raid_t *raidPtr,
    175  1.1  oster 	RF_AccessStripeMap_t *asmap, RF_PhysDiskAddr_t *failedPDA,
    176  1.1  oster 	RF_DagHeader_t *dag_h, RF_AccessStripeMapHeader_t **new_asm_h,
    177  1.1  oster 	int *nXorBufs, char **rpBufPtr, char *overlappingPDAs,
    178  1.1  oster 	RF_AllocListElem_t *allocList);
    179  1.1  oster 
    180  1.1  oster /* flags used by RangeRestrictPDA */
    181  1.1  oster #define RF_RESTRICT_NOBUFFER 0
    182  1.1  oster #define RF_RESTRICT_DOBUFFER 1
    183  1.1  oster 
    184  1.1  oster void rf_RangeRestrictPDA(RF_Raid_t *raidPtr, RF_PhysDiskAddr_t *src,
    185  1.1  oster 	RF_PhysDiskAddr_t *dest, int dobuffer, int doraidaddr);
    186  1.1  oster 
    187  1.1  oster int rf_compute_workload_shift(RF_Raid_t *raidPtr, RF_PhysDiskAddr_t *pda);
    188  1.1  oster void rf_SelectMirrorDiskIdle(RF_DagNode_t *node);
    189  1.1  oster void rf_SelectMirrorDiskPartition(RF_DagNode_t *node);
    190  1.1  oster 
    191  1.1  oster #endif /* !_RF__RF_DAGUTILS_H_ */
    192