1 /* $NetBSD: rf_desc.h,v 1.3 1999/01/26 02:33:55 oster Exp $ */ 2 /* 3 * Copyright (c) 1995 Carnegie-Mellon University. 4 * All rights reserved. 5 * 6 * Author: Mark Holland 7 * 8 * Permission to use, copy, modify and distribute this software and 9 * its documentation is hereby granted, provided that both the copyright 10 * notice and this permission notice appear in all copies of the 11 * software, derivative works or modified versions, and any portions 12 * thereof, and that both notices appear in supporting documentation. 13 * 14 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 15 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND 16 * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 17 * 18 * Carnegie Mellon requests users of this software to return to 19 * 20 * Software Distribution Coordinator or Software.Distribution (at) CS.CMU.EDU 21 * School of Computer Science 22 * Carnegie Mellon University 23 * Pittsburgh PA 15213-3890 24 * 25 * any improvements or extensions that they make and grant Carnegie the 26 * rights to redistribute these changes. 27 */ 28 29 #ifndef _RF__RF_DESC_H_ 30 #define _RF__RF_DESC_H_ 31 32 #include "rf_archs.h" 33 #include "rf_types.h" 34 #include "rf_etimer.h" 35 #include "rf_dag.h" 36 37 struct RF_RaidReconDesc_s { 38 RF_Raid_t *raidPtr; /* raid device descriptor */ 39 RF_RowCol_t row; /* row of failed disk */ 40 RF_RowCol_t col; /* col of failed disk */ 41 int state; /* how far along the reconstruction operation has gotten */ 42 RF_RaidDisk_t *spareDiskPtr; /* describes target disk for recon (not used in dist sparing) */ 43 int numDisksDone; /* the number of surviving disks that have completed their work */ 44 RF_RowCol_t srow; /* row ID of the spare disk (not used in dist sparing) */ 45 RF_RowCol_t scol; /* col ID of the spare disk (not used in dist sparing) */ 46 /* 47 * Prevent recon from hogging CPU 48 */ 49 RF_Etimer_t recon_exec_timer; 50 RF_uint64 reconExecTimerRunning; 51 RF_uint64 reconExecTicks; 52 RF_uint64 maxReconExecTicks; 53 54 #if RF_RECON_STATS > 0 55 RF_uint64 hsStallCount; /* head sep stall count */ 56 RF_uint64 numReconExecDelays; 57 RF_uint64 numReconEventWaits; 58 #endif /* RF_RECON_STATS > 0 */ 59 RF_RaidReconDesc_t *next; 60 }; 61 62 struct RF_RaidAccessDesc_s { 63 RF_Raid_t *raidPtr; /* raid device descriptor */ 64 RF_IoType_t type; /* read or write */ 65 RF_RaidAddr_t raidAddress; /* starting address in raid address space */ 66 RF_SectorCount_t numBlocks; /* number of blocks (sectors) to transfer */ 67 RF_StripeCount_t numStripes; /* number of stripes involved in access */ 68 caddr_t bufPtr; /* pointer to data buffer */ 69 RF_RaidAccessFlags_t flags; /* flags controlling operation */ 70 int state; /* index into states telling how far along the RAID operation has gotten */ 71 RF_AccessState_t *states; /* array of states to be run */ 72 int status; /* pass/fail status of the last operation */ 73 RF_DagList_t *dagArray; /* array of dag lists, one list per stripe */ 74 RF_AccessStripeMapHeader_t *asmap; /* the asm for this I/O */ 75 void *bp; /* buf pointer for this RAID acc. ignored outside the kernel */ 76 RF_DagHeader_t **paramDAG; /* allows the DAG to be returned to the caller after I/O completion */ 77 RF_AccessStripeMapHeader_t **paramASM; /* allows the ASM to be returned to the caller after I/O completion */ 78 RF_AccTraceEntry_t tracerec; /* perf monitoring information for a user access (not for dag stats) */ 79 void (*callbackFunc)(RF_CBParam_t); /* callback function for this I/O */ 80 void *callbackArg; /* arg to give to callback func */ 81 int tid; /* debug only, user-level only: thread id of thr that did this access */ 82 83 RF_AllocListElem_t *cleanupList; /* memory to be freed at the end of the access*/ 84 85 RF_RaidAccessDesc_t *next; 86 RF_RaidAccessDesc_t *head; 87 88 int numPending; 89 90 RF_DECLARE_MUTEX(mutex) /* these are used to implement blocking I/O */ 91 RF_DECLARE_COND(cond) 92 93 int async_flag; 94 95 RF_Etimer_t timer; /* used for timing this access */ 96 }; 97 98 #endif /* !_RF__RF_DESC_H_ */ 99