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