rf_fifo.h revision 1.1 1 1.1 oster /* $NetBSD: rf_fifo.h,v 1.1 1998/11/13 04:20:30 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 /*
30 1.1 oster * rf_fifo.h -- prioritized FIFO queue code.
31 1.1 oster *
32 1.1 oster * 4-9-93 Created (MCH)
33 1.1 oster */
34 1.1 oster
35 1.1 oster /*
36 1.1 oster * :
37 1.1 oster * Log: rf_fifo.h,v
38 1.1 oster * Revision 1.12 1996/06/18 20:53:11 jimz
39 1.1 oster * fix up disk queueing (remove configure routine,
40 1.1 oster * add shutdown list arg to create routines)
41 1.1 oster *
42 1.1 oster * Revision 1.11 1996/06/13 20:41:28 jimz
43 1.1 oster * add random queueing
44 1.1 oster *
45 1.1 oster * Revision 1.10 1996/06/13 20:38:28 jimz
46 1.1 oster * add random dequeue, peek
47 1.1 oster *
48 1.1 oster * Revision 1.9 1996/06/09 02:36:46 jimz
49 1.1 oster * lots of little crufty cleanup- fixup whitespace
50 1.1 oster * issues, comment #ifdefs, improve typing in some
51 1.1 oster * places (esp size-related)
52 1.1 oster *
53 1.1 oster * Revision 1.8 1996/06/07 22:26:27 jimz
54 1.1 oster * type-ify which_ru (RF_ReconUnitNum_t)
55 1.1 oster *
56 1.1 oster * Revision 1.7 1996/06/07 21:33:04 jimz
57 1.1 oster * begin using consistent types for sector numbers,
58 1.1 oster * stripe numbers, row+col numbers, recon unit numbers
59 1.1 oster *
60 1.1 oster * Revision 1.6 1996/05/30 23:22:16 jimz
61 1.1 oster * bugfixes of serialization, timing problems
62 1.1 oster * more cleanup
63 1.1 oster *
64 1.1 oster * Revision 1.5 1996/05/30 11:29:41 jimz
65 1.1 oster * Numerous bug fixes. Stripe lock release code disagreed with the taking code
66 1.1 oster * about when stripes should be locked (I made it consistent: no parity, no lock)
67 1.1 oster * There was a lot of extra serialization of I/Os which I've removed- a lot of
68 1.1 oster * it was to calculate values for the cache code, which is no longer with us.
69 1.1 oster * More types, function, macro cleanup. Added code to properly quiesce the array
70 1.1 oster * on shutdown. Made a lot of stuff array-specific which was (bogusly) general
71 1.1 oster * before. Fixed memory allocation, freeing bugs.
72 1.1 oster *
73 1.1 oster * Revision 1.4 1996/05/23 21:46:35 jimz
74 1.1 oster * checkpoint in code cleanup (release prep)
75 1.1 oster * lots of types, function names have been fixed
76 1.1 oster *
77 1.1 oster * Revision 1.3 1995/12/01 18:22:26 root
78 1.1 oster * added copyright info
79 1.1 oster *
80 1.1 oster * Revision 1.2 1995/11/07 15:31:57 wvcii
81 1.1 oster * added Peek() function
82 1.1 oster *
83 1.1 oster */
84 1.1 oster
85 1.1 oster #ifndef _RF__RF_FIFO_H_
86 1.1 oster #define _RF__RF_FIFO_H_
87 1.1 oster
88 1.1 oster #include "rf_archs.h"
89 1.1 oster #include "rf_types.h"
90 1.1 oster #include "rf_diskqueue.h"
91 1.1 oster
92 1.1 oster typedef struct RF_FifoHeader_s {
93 1.1 oster RF_DiskQueueData_t *hq_head, *hq_tail; /* high priority requests */
94 1.1 oster RF_DiskQueueData_t *lq_head, *lq_tail; /* low priority requests */
95 1.1 oster int hq_count, lq_count; /* debug only */
96 1.1 oster #if !defined(KERNEL) && RF_INCLUDE_QUEUE_RANDOM > 0
97 1.1 oster long rval; /* next random number (random qpolicy) */
98 1.1 oster #endif /* !KERNEL && RF_INCLUDE_QUEUE_RANDOM > 0 */
99 1.1 oster } RF_FifoHeader_t;
100 1.1 oster
101 1.1 oster extern void *rf_FifoCreate(RF_SectorCount_t sectPerDisk,
102 1.1 oster RF_AllocListElem_t *clList, RF_ShutdownList_t **listp);
103 1.1 oster extern void rf_FifoEnqueue(void *q_in, RF_DiskQueueData_t *elem,
104 1.1 oster int priority);
105 1.1 oster extern RF_DiskQueueData_t *rf_FifoDequeue(void *q_in);
106 1.1 oster extern RF_DiskQueueData_t *rf_FifoPeek(void *q_in);
107 1.1 oster extern int rf_FifoPromote(void *q_in, RF_StripeNum_t parityStripeID,
108 1.1 oster RF_ReconUnitNum_t which_ru);
109 1.1 oster #if !defined(KERNEL) && RF_INCLUDE_QUEUE_RANDOM > 0
110 1.1 oster extern RF_DiskQueueData_t *rf_RandomDequeue(void *q_in);
111 1.1 oster extern RF_DiskQueueData_t *rf_RandomPeek(void *q_in);
112 1.1 oster #endif /* !KERNEL && RF_INCLUDE_QUEUE_RANDOM > 0 */
113 1.1 oster
114 1.1 oster #endif /* !_RF__RF_FIFO_H_ */
115