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