Home | History | Annotate | Line # | Download | only in raidframe
      1  1.22     oster /*	$NetBSD: rf_desc.h,v 1.22 2021/07/23 02:35:14 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.13     oster #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 	RF_RaidDisk_t *spareDiskPtr;	/* describes target disk for recon
     43   1.4     oster 					 * (not used in dist sparing) */
     44   1.4     oster 	int     numDisksDone;	/* the number of surviving disks that have
     45   1.4     oster 				 * completed their work */
     46   1.4     oster 	RF_RowCol_t scol;	/* col ID of the spare disk (not used in dist
     47   1.4     oster 				 * sparing) */
     48   1.4     oster 	/*
     49   1.4     oster          * Prevent recon from hogging CPU
     50   1.4     oster          */
     51   1.4     oster 	RF_Etimer_t recon_exec_timer;
     52   1.4     oster 	RF_uint64 reconExecTimerRunning;
     53   1.4     oster 	RF_uint64 reconExecTicks;
     54   1.4     oster 	RF_uint64 maxReconExecTicks;
     55   1.1     oster 
     56   1.1     oster #if RF_RECON_STATS > 0
     57   1.4     oster 	RF_uint64 hsStallCount;	/* head sep stall count */
     58   1.4     oster 	RF_uint64 numReconExecDelays;
     59   1.4     oster 	RF_uint64 numReconEventWaits;
     60   1.4     oster #endif				/* RF_RECON_STATS > 0 */
     61   1.4     oster 	RF_RaidReconDesc_t *next;
     62   1.1     oster };
     63   1.1     oster 
     64   1.1     oster struct RF_RaidAccessDesc_s {
     65   1.4     oster 	RF_Raid_t *raidPtr;	/* raid device descriptor */
     66   1.4     oster 	RF_IoType_t type;	/* read or write */
     67   1.4     oster 	RF_RaidAddr_t raidAddress;	/* starting address in raid address
     68   1.4     oster 					 * space */
     69   1.4     oster 	RF_SectorCount_t numBlocks;	/* number of blocks (sectors) to
     70   1.4     oster 					 * transfer */
     71   1.4     oster 	RF_StripeCount_t numStripes;	/* number of stripes involved in
     72   1.4     oster 					 * access */
     73  1.20  christos 	void *bufPtr;		/* pointer to data buffer */
     74   1.4     oster 	RF_RaidAccessFlags_t flags;	/* flags controlling operation */
     75   1.4     oster 	int     state;		/* index into states telling how far along the
     76   1.4     oster 				 * RAID operation has gotten */
     77  1.14  drochner 	const RF_AccessState_t *states;	/* array of states to be run */
     78   1.4     oster 	int     status;		/* pass/fail status of the last operation */
     79  1.15     oster 	int     numRetries;     /* number of times this IO has been attempted */
     80  1.10     oster 	RF_DagList_t *dagList;	/* list of dag lists, one list per stripe */
     81  1.18     perry 	RF_VoidPointerListElem_t *iobufs; /* iobufs that need to be cleaned
     82  1.13     oster 					     up at the end of this IO */
     83  1.18     perry 	RF_VoidPointerListElem_t *stripebufs; /* stripe buffers that need to
     84  1.13     oster 						 be cleaned up at the end of
     85  1.13     oster 						 this IO */
     86   1.4     oster 	RF_AccessStripeMapHeader_t *asmap;	/* the asm for this I/O */
     87  1.17     oster 	struct buf *bp;		/* buf pointer for this RAID acc */
     88   1.4     oster 	RF_AccTraceEntry_t tracerec;	/* perf monitoring information for a
     89   1.4     oster 					 * user access (not for dag stats) */
     90  1.21  christos 	void    (*callbackFunc) (void *);	/* callback function for this
     91   1.4     oster 						 * I/O */
     92   1.4     oster 	void   *callbackArg;	/* arg to give to callback func */
     93   1.4     oster 	RF_RaidAccessDesc_t *next;
     94   1.4     oster 	RF_Etimer_t timer;	/* used for timing this access */
     95   1.1     oster };
     96   1.4     oster #endif				/* !_RF__RF_DESC_H_ */
     97