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