Home | History | Annotate | Line # | Download | only in raidframe
rf_desc.h revision 1.6
      1  1.6  oster /*	$NetBSD: rf_desc.h,v 1.6 2001/10/04 15:58:52 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
      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 #ifndef _RF__RF_DESC_H_
     30  1.1  oster #define _RF__RF_DESC_H_
     31  1.1  oster 
     32  1.6  oster #include <dev/raidframe/raidframevar.h>
     33  1.6  oster 
     34  1.1  oster #include "rf_archs.h"
     35  1.1  oster #include "rf_etimer.h"
     36  1.1  oster #include "rf_dag.h"
     37  1.1  oster 
     38  1.1  oster struct RF_RaidReconDesc_s {
     39  1.4  oster 	RF_Raid_t *raidPtr;	/* raid device descriptor */
     40  1.4  oster 	RF_RowCol_t row;	/* row of failed disk */
     41  1.4  oster 	RF_RowCol_t col;	/* col of failed disk */
     42  1.4  oster 	int     state;		/* how far along the reconstruction operation
     43  1.4  oster 				 * has gotten */
     44  1.4  oster 	RF_RaidDisk_t *spareDiskPtr;	/* describes target disk for recon
     45  1.4  oster 					 * (not used in dist sparing) */
     46  1.4  oster 	int     numDisksDone;	/* the number of surviving disks that have
     47  1.4  oster 				 * completed their work */
     48  1.4  oster 	RF_RowCol_t srow;	/* row ID of the spare disk (not used in dist
     49  1.4  oster 				 * sparing) */
     50  1.4  oster 	RF_RowCol_t scol;	/* col ID of the spare disk (not used in dist
     51  1.4  oster 				 * sparing) */
     52  1.4  oster 	/*
     53  1.4  oster          * Prevent recon from hogging CPU
     54  1.4  oster          */
     55  1.4  oster 	RF_Etimer_t recon_exec_timer;
     56  1.4  oster 	RF_uint64 reconExecTimerRunning;
     57  1.4  oster 	RF_uint64 reconExecTicks;
     58  1.4  oster 	RF_uint64 maxReconExecTicks;
     59  1.1  oster 
     60  1.1  oster #if RF_RECON_STATS > 0
     61  1.4  oster 	RF_uint64 hsStallCount;	/* head sep stall count */
     62  1.4  oster 	RF_uint64 numReconExecDelays;
     63  1.4  oster 	RF_uint64 numReconEventWaits;
     64  1.4  oster #endif				/* RF_RECON_STATS > 0 */
     65  1.4  oster 	RF_RaidReconDesc_t *next;
     66  1.1  oster };
     67  1.1  oster 
     68  1.1  oster struct RF_RaidAccessDesc_s {
     69  1.4  oster 	RF_Raid_t *raidPtr;	/* raid device descriptor */
     70  1.4  oster 	RF_IoType_t type;	/* read or write */
     71  1.4  oster 	RF_RaidAddr_t raidAddress;	/* starting address in raid address
     72  1.4  oster 					 * space */
     73  1.4  oster 	RF_SectorCount_t numBlocks;	/* number of blocks (sectors) to
     74  1.4  oster 					 * transfer */
     75  1.4  oster 	RF_StripeCount_t numStripes;	/* number of stripes involved in
     76  1.4  oster 					 * access */
     77  1.4  oster 	caddr_t bufPtr;		/* pointer to data buffer */
     78  1.4  oster 	RF_RaidAccessFlags_t flags;	/* flags controlling operation */
     79  1.4  oster 	int     state;		/* index into states telling how far along the
     80  1.4  oster 				 * RAID operation has gotten */
     81  1.4  oster 	RF_AccessState_t *states;	/* array of states to be run */
     82  1.4  oster 	int     status;		/* pass/fail status of the last operation */
     83  1.4  oster 	RF_DagList_t *dagArray;	/* array of dag lists, one list per stripe */
     84  1.4  oster 	RF_AccessStripeMapHeader_t *asmap;	/* the asm for this I/O */
     85  1.4  oster 	void   *bp;		/* buf pointer for this RAID acc.  ignored
     86  1.4  oster 				 * outside the kernel */
     87  1.4  oster 	RF_DagHeader_t **paramDAG;	/* allows the DAG to be returned to
     88  1.4  oster 					 * the caller after I/O completion */
     89  1.4  oster 	RF_AccessStripeMapHeader_t **paramASM;	/* allows the ASM to be
     90  1.4  oster 						 * returned to the caller
     91  1.4  oster 						 * after I/O completion */
     92  1.4  oster 	RF_AccTraceEntry_t tracerec;	/* perf monitoring information for a
     93  1.4  oster 					 * user access (not for dag stats) */
     94  1.4  oster 	void    (*callbackFunc) (RF_CBParam_t);	/* callback function for this
     95  1.4  oster 						 * I/O */
     96  1.4  oster 	void   *callbackArg;	/* arg to give to callback func */
     97  1.4  oster 
     98  1.4  oster 	RF_AllocListElem_t *cleanupList;	/* memory to be freed at the
     99  1.4  oster 						 * end of the access */
    100  1.4  oster 
    101  1.4  oster 	RF_RaidAccessDesc_t *next;
    102  1.4  oster 	RF_RaidAccessDesc_t *head;
    103  1.4  oster 
    104  1.4  oster 	int     numPending;
    105  1.4  oster 
    106  1.4  oster 	        RF_DECLARE_MUTEX(mutex)	/* these are used to implement
    107  1.4  oster 					 * blocking I/O */
    108  1.4  oster 	        RF_DECLARE_COND(cond)
    109  1.4  oster 	int     async_flag;
    110  1.1  oster 
    111  1.4  oster 	RF_Etimer_t timer;	/* used for timing this access */
    112  1.1  oster };
    113  1.4  oster #endif				/* !_RF__RF_DESC_H_ */
    114