Home | History | Annotate | Line # | Download | only in raidframe
rf_desc.h revision 1.12.2.2.2.1
      1      1.12.2.1   tron /*	$NetBSD: rf_desc.h,v 1.12.2.2.2.1 2005/04/06 12:13:49 tron 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.12.2.1   tron #include "rf_layout.h"
     38           1.1  oster 
     39           1.1  oster struct RF_RaidReconDesc_s {
     40           1.4  oster 	RF_Raid_t *raidPtr;	/* raid device descriptor */
     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 scol;	/* col ID of the spare disk (not used in dist
     49           1.4  oster 				 * sparing) */
     50           1.4  oster 	/*
     51           1.4  oster          * Prevent recon from hogging CPU
     52           1.4  oster          */
     53           1.4  oster 	RF_Etimer_t recon_exec_timer;
     54           1.4  oster 	RF_uint64 reconExecTimerRunning;
     55           1.4  oster 	RF_uint64 reconExecTicks;
     56           1.4  oster 	RF_uint64 maxReconExecTicks;
     57           1.1  oster 
     58           1.1  oster #if RF_RECON_STATS > 0
     59           1.4  oster 	RF_uint64 hsStallCount;	/* head sep stall count */
     60           1.4  oster 	RF_uint64 numReconExecDelays;
     61           1.4  oster 	RF_uint64 numReconEventWaits;
     62           1.4  oster #endif				/* RF_RECON_STATS > 0 */
     63           1.4  oster 	RF_RaidReconDesc_t *next;
     64           1.1  oster };
     65           1.1  oster 
     66           1.1  oster struct RF_RaidAccessDesc_s {
     67           1.4  oster 	RF_Raid_t *raidPtr;	/* raid device descriptor */
     68           1.4  oster 	RF_IoType_t type;	/* read or write */
     69           1.4  oster 	RF_RaidAddr_t raidAddress;	/* starting address in raid address
     70           1.4  oster 					 * space */
     71           1.4  oster 	RF_SectorCount_t numBlocks;	/* number of blocks (sectors) to
     72           1.4  oster 					 * transfer */
     73           1.4  oster 	RF_StripeCount_t numStripes;	/* number of stripes involved in
     74           1.4  oster 					 * access */
     75           1.4  oster 	caddr_t bufPtr;		/* pointer to data buffer */
     76           1.4  oster 	RF_RaidAccessFlags_t flags;	/* flags controlling operation */
     77           1.4  oster 	int     state;		/* index into states telling how far along the
     78           1.4  oster 				 * RAID operation has gotten */
     79      1.12.2.2   tron 	const RF_AccessState_t *states;	/* array of states to be run */
     80           1.4  oster 	int     status;		/* pass/fail status of the last operation */
     81  1.12.2.2.2.1   tron 	int     numRetries;     /* number of times this IO has been attempted */
     82          1.10  oster 	RF_DagList_t *dagList;	/* list of dag lists, one list per stripe */
     83      1.12.2.1   tron 	RF_VoidPointerListElem_t *iobufs; /* iobufs that need to be cleaned
     84      1.12.2.1   tron 					     up at the end of this IO */
     85      1.12.2.1   tron 	RF_VoidPointerListElem_t *stripebufs; /* stripe buffers that need to
     86      1.12.2.1   tron 						 be cleaned up at the end of
     87      1.12.2.1   tron 						 this IO */
     88           1.4  oster 	RF_AccessStripeMapHeader_t *asmap;	/* the asm for this I/O */
     89           1.4  oster 	void   *bp;		/* buf pointer for this RAID acc.  ignored
     90           1.4  oster 				 * outside the kernel */
     91           1.4  oster 	RF_AccTraceEntry_t tracerec;	/* perf monitoring information for a
     92           1.4  oster 					 * user access (not for dag stats) */
     93           1.4  oster 	void    (*callbackFunc) (RF_CBParam_t);	/* callback function for this
     94           1.4  oster 						 * I/O */
     95           1.4  oster 	void   *callbackArg;	/* arg to give to callback func */
     96           1.4  oster 	RF_RaidAccessDesc_t *next;
     97           1.4  oster 	int     async_flag;
     98           1.4  oster 	RF_Etimer_t timer;	/* used for timing this access */
     99           1.1  oster };
    100           1.4  oster #endif				/* !_RF__RF_DESC_H_ */
    101