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