summaryrefslogtreecommitdiff
path: root/sys/dev/raidframe/rf_fifo.c
diff options
context:
space:
mode:
authorPeter Galbavy <peter@cvs.openbsd.org>2000-08-08 16:07:46 +0000
committerPeter Galbavy <peter@cvs.openbsd.org>2000-08-08 16:07:46 +0000
commit32fe17a663470bcff500ec1d022251eb5521ca1d (patch)
treea9d50274c1f5d004d13fa30644899af9b22328ee /sys/dev/raidframe/rf_fifo.c
parentba14061bb6dd00dd21fcd589dca3d5be75d8f752 (diff)
sync RAIDframe with Gre Oster's work for NetBSD.
This update incorporates changes since January 2000. RAID1 and RAID5 tested for functionality matching the 2.7 code. A number of bug fixes (including stopping a parity rebuild when unconfiguring) have been included. See Greg's RAIDframe info page: http://www.cs.usask.ca/staff/oster/raid.html The RAID_AUTOCONFIG feature set does *NOT* yet work. These features require more work throughout the boot system and as such are a big task. IMPORTANT: As with anything that is this near live data on your systems, please test carefully with existing configurations before deploying in a live system. Feedback via sendbug or mail direct to peter@wonderland.org is appreciated.
Diffstat (limited to 'sys/dev/raidframe/rf_fifo.c')
-rw-r--r--sys/dev/raidframe/rf_fifo.c90
1 files changed, 2 insertions, 88 deletions
diff --git a/sys/dev/raidframe/rf_fifo.c b/sys/dev/raidframe/rf_fifo.c
index 411f1b65cc8..4e37d7e36a0 100644
--- a/sys/dev/raidframe/rf_fifo.c
+++ b/sys/dev/raidframe/rf_fifo.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: rf_fifo.c,v 1.4 2000/01/11 18:02:22 peter Exp $ */
-/* $NetBSD: rf_fifo.c,v 1.4 2000/01/08 23:45:05 oster Exp $ */
+/* $OpenBSD: rf_fifo.c,v 1.5 2000/08/08 16:07:41 peter Exp $ */
+/* $NetBSD: rf_fifo.c,v 1.5 2000/03/04 03:27:13 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@@ -147,92 +147,6 @@ rf_FifoDequeue(q_in)
}
return (nd);
}
-/* This never gets used!! No loss (I hope) if we don't include it... GO */
-#if !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(_KERNEL)
-
-static RF_DiskQueueData_t *
-n_in_q(headp, tailp, countp, n, deq)
- RF_DiskQueueData_t **headp;
- RF_DiskQueueData_t **tailp;
- int *countp;
- int n;
- int deq;
-{
- RF_DiskQueueData_t *r, *s;
- int i;
-
- for (s = NULL, i = n, r = *headp; r; s = r, r = r->next) {
- if (i == 0)
- break;
- i--;
- }
- RF_ASSERT(r != NULL);
- if (deq == 0)
- return (r);
- if (s) {
- s->next = r->next;
- } else {
- *headp = r->next;
- }
- if (*tailp == r)
- *tailp = s;
- (*countp)--;
- return (r);
-}
-#endif
-
-#if !defined(_KERNEL) && RF_INCLUDE_QUEUE_RANDOM > 0
-RF_DiskQueueData_t *
-rf_RandomPeek(q_in)
- void *q_in;
-{
- RF_FifoHeader_t *q = (RF_FifoHeader_t *) q_in;
- RF_DiskQueueData_t *req;
- int n;
-
- if (q->hq_head) {
- n = q->rval % q->hq_count;
- req = n_in_q(&q->hq_head, &q->hq_tail, &q->hq_count, n, 0);
- } else {
- RF_ASSERT(q->hq_count == 0);
- if (q->lq_head == NULL) {
- RF_ASSERT(q->lq_count == 0);
- return (NULL);
- }
- n = q->rval % q->lq_count;
- req = n_in_q(&q->lq_head, &q->lq_tail, &q->lq_count, n, 0);
- }
- RF_ASSERT((q->hq_count + q->lq_count) == req->queue->queueLength);
- RF_ASSERT(req != NULL);
- return (req);
-}
-
-RF_DiskQueueData_t *
-rf_RandomDequeue(q_in)
- void *q_in;
-{
- RF_FifoHeader_t *q = (RF_FifoHeader_t *) q_in;
- RF_DiskQueueData_t *req;
- int n;
-
- if (q->hq_head) {
- n = q->rval % q->hq_count;
- q->rval = (long) RF_STATIC_RANDOM();
- req = n_in_q(&q->hq_head, &q->hq_tail, &q->hq_count, n, 1);
- } else {
- RF_ASSERT(q->hq_count == 0);
- if (q->lq_head == NULL) {
- RF_ASSERT(q->lq_count == 0);
- return (NULL);
- }
- n = q->rval % q->lq_count;
- q->rval = (long) RF_STATIC_RANDOM();
- req = n_in_q(&q->lq_head, &q->lq_tail, &q->lq_count, n, 1);
- }
- RF_ASSERT((q->hq_count + q->lq_count) == (req->queue->queueLength - 1));
- return (req);
-}
-#endif /* !_KERNEL && RF_INCLUDE_QUEUE_RANDOM > 0 */
/* Return ptr to item at head of queue. Used to examine request
* info without actually dequeueing the request.