Module Name: src
Committed By: oster
Date: Fri Jul 23 20:18:24 UTC 2021
Modified Files:
src/sys/dev/raidframe: rf_diskqueue.c rf_diskqueue.h rf_fifo.c
rf_fifo.h rf_sstf.c rf_sstf.h
Log Message:
Various disk queue "peek" routines were only ever used in the simulator
version of RAIDFrame. Remove them from here.
To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/sys/dev/raidframe/rf_diskqueue.c
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/raidframe/rf_diskqueue.h
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/raidframe/rf_fifo.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/raidframe/rf_fifo.h
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/raidframe/rf_sstf.c
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/raidframe/rf_sstf.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/raidframe/rf_diskqueue.c
diff -u src/sys/dev/raidframe/rf_diskqueue.c:1.60 src/sys/dev/raidframe/rf_diskqueue.c:1.61
--- src/sys/dev/raidframe/rf_diskqueue.c:1.60 Fri Jul 23 00:54:45 2021
+++ src/sys/dev/raidframe/rf_diskqueue.c Fri Jul 23 20:18:24 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_diskqueue.c,v 1.60 2021/07/23 00:54:45 oster Exp $ */
+/* $NetBSD: rf_diskqueue.c,v 1.61 2021/07/23 20:18:24 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@@ -66,7 +66,7 @@
****************************************************************************/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_diskqueue.c,v 1.60 2021/07/23 00:54:45 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_diskqueue.c,v 1.61 2021/07/23 20:18:24 oster Exp $");
#include <dev/raidframe/raidframevar.h>
@@ -115,36 +115,31 @@ static const RF_DiskQueueSW_t diskqueues
rf_FifoCreate,
rf_FifoEnqueue,
rf_FifoDequeue,
- rf_FifoPeek,
- rf_FifoPromote},
+ rf_FifoPromote},
{"cvscan", /* cvscan */
rf_CvscanCreate,
rf_CvscanEnqueue,
rf_CvscanDequeue,
- rf_CvscanPeek,
- rf_CvscanPromote},
+ rf_CvscanPromote},
{"sstf", /* shortest seek time first */
rf_SstfCreate,
rf_SstfEnqueue,
rf_SstfDequeue,
- rf_SstfPeek,
- rf_SstfPromote},
+ rf_SstfPromote},
{"scan", /* SCAN (two-way elevator) */
rf_ScanCreate,
rf_SstfEnqueue,
rf_ScanDequeue,
- rf_ScanPeek,
- rf_SstfPromote},
+ rf_SstfPromote},
{"cscan", /* CSCAN (one-way elevator) */
rf_CscanCreate,
rf_SstfEnqueue,
rf_CscanDequeue,
- rf_CscanPeek,
- rf_SstfPromote},
+ rf_SstfPromote},
};
#define NUM_DISK_QUEUE_TYPES (sizeof(diskqueuesw)/sizeof(RF_DiskQueueSW_t))
Index: src/sys/dev/raidframe/rf_diskqueue.h
diff -u src/sys/dev/raidframe/rf_diskqueue.h:1.27 src/sys/dev/raidframe/rf_diskqueue.h:1.28
--- src/sys/dev/raidframe/rf_diskqueue.h:1.27 Fri Jul 23 00:54:45 2021
+++ src/sys/dev/raidframe/rf_diskqueue.h Fri Jul 23 20:18:24 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_diskqueue.h,v 1.27 2021/07/23 00:54:45 oster Exp $ */
+/* $NetBSD: rf_diskqueue.h,v 1.28 2021/07/23 20:18:24 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@@ -89,7 +89,6 @@ struct RF_DiskQueueSW_s {
* system */
void (*Enqueue) (void *, RF_DiskQueueData_t *, int); /* enqueue routine */
RF_DiskQueueData_t *(*Dequeue) (void *); /* dequeue routine */
- RF_DiskQueueData_t *(*Peek) (void *); /* peek at head of queue */
/* the rest are optional: they improve performance, but the driver
* will deal with it if they don't exist */
Index: src/sys/dev/raidframe/rf_fifo.c
diff -u src/sys/dev/raidframe/rf_fifo.c:1.16 src/sys/dev/raidframe/rf_fifo.c:1.17
--- src/sys/dev/raidframe/rf_fifo.c:1.16 Sat Feb 9 03:34:00 2019
+++ src/sys/dev/raidframe/rf_fifo.c Fri Jul 23 20:18:24 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_fifo.c,v 1.16 2019/02/09 03:34:00 christos Exp $ */
+/* $NetBSD: rf_fifo.c,v 1.17 2021/07/23 20:18:24 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@@ -36,7 +36,7 @@
***************************************************/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_fifo.c,v 1.16 2019/02/09 03:34:00 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_fifo.c,v 1.17 2021/07/23 20:18:24 oster Exp $");
#include <dev/raidframe/raidframevar.h>
@@ -147,23 +147,6 @@ rf_FifoDequeue(void *q_in)
return (nd);
}
-/* Return ptr to item at head of queue. Used to examine request
- * info without actually dequeueing the request.
- */
-RF_DiskQueueData_t *
-rf_FifoPeek(void *q_in)
-{
- RF_DiskQueueData_t *headElement = NULL;
- RF_FifoHeader_t *q = (RF_FifoHeader_t *) q_in;
-
- RF_ASSERT(q);
- if (q->hq_head)
- headElement = q->hq_head;
- else
- if (q->lq_head)
- headElement = q->lq_head;
- return (headElement);
-}
/* We sometimes need to promote a low priority access to a regular priority access.
* Currently, this is only used when the user wants to write a stripe which is currently
* under reconstruction.
Index: src/sys/dev/raidframe/rf_fifo.h
diff -u src/sys/dev/raidframe/rf_fifo.h:1.6 src/sys/dev/raidframe/rf_fifo.h:1.7
--- src/sys/dev/raidframe/rf_fifo.h:1.6 Sun Dec 11 12:23:37 2005
+++ src/sys/dev/raidframe/rf_fifo.h Fri Jul 23 20:18:24 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_fifo.h,v 1.6 2005/12/11 12:23:37 christos Exp $ */
+/* $NetBSD: rf_fifo.h,v 1.7 2021/07/23 20:18:24 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@@ -54,7 +54,6 @@ extern void
rf_FifoEnqueue(void *q_in, RF_DiskQueueData_t * elem,
int priority);
extern RF_DiskQueueData_t *rf_FifoDequeue(void *q_in);
-extern RF_DiskQueueData_t *rf_FifoPeek(void *q_in);
extern int
rf_FifoPromote(void *q_in, RF_StripeNum_t parityStripeID,
RF_ReconUnitNum_t which_ru);
Index: src/sys/dev/raidframe/rf_sstf.c
diff -u src/sys/dev/raidframe/rf_sstf.c:1.17 src/sys/dev/raidframe/rf_sstf.c:1.18
--- src/sys/dev/raidframe/rf_sstf.c:1.17 Sat Feb 9 03:34:00 2019
+++ src/sys/dev/raidframe/rf_sstf.c Fri Jul 23 20:18:24 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_sstf.c,v 1.17 2019/02/09 03:34:00 christos Exp $ */
+/* $NetBSD: rf_sstf.c,v 1.18 2021/07/23 20:18:24 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@@ -33,7 +33,7 @@
******************************************************************************/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_sstf.c,v 1.17 2019/02/09 03:34:00 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_sstf.c,v 1.18 2021/07/23 20:18:24 oster Exp $");
#include <dev/raidframe/raidframevar.h>
@@ -509,117 +509,6 @@ rf_CscanDequeue(void *qptr)
return (req);
}
-RF_DiskQueueData_t *
-rf_SstfPeek(void *qptr)
-{
- RF_DiskQueueData_t *req;
- RF_Sstf_t *sstfq;
-
- sstfq = (RF_Sstf_t *) qptr;
-
- if ((sstfq->left.queue == NULL) && (sstfq->right.queue == NULL)) {
- req = closest_to_arm(&sstfq->lopri, sstfq->last_sector, &sstfq->dir,
- sstfq->allow_reverse);
- } else {
- if (sstfq->left.queue == NULL)
- req = sstfq->right.queue;
- else {
- if (sstfq->right.queue == NULL)
- req = sstfq->left.queue;
- else {
- if (SNUM_DIFF(sstfq->last_sector, sstfq->right.queue->sectorOffset)
- < SNUM_DIFF(sstfq->last_sector, sstfq->left.qtail->sectorOffset)) {
- req = sstfq->right.queue;
- } else {
- req = sstfq->left.qtail;
- }
- }
- }
- }
- if (req == NULL) {
- RF_ASSERT(QSUM(sstfq) == 0);
- }
- return (req);
-}
-
-RF_DiskQueueData_t *
-rf_ScanPeek(void *qptr)
-{
- RF_DiskQueueData_t *req;
- RF_Sstf_t *scanq;
- int dir;
-
- scanq = (RF_Sstf_t *) qptr;
- dir = scanq->dir;
-
- if (scanq->left.queue == NULL) {
- RF_ASSERT(scanq->left.qlen == 0);
- if (scanq->right.queue == NULL) {
- RF_ASSERT(scanq->right.qlen == 0);
- if (scanq->lopri.queue == NULL) {
- RF_ASSERT(scanq->lopri.qlen == 0);
- return (NULL);
- }
- req = closest_to_arm(&scanq->lopri, scanq->last_sector,
- &dir, scanq->allow_reverse);
- } else {
- req = scanq->right.queue;
- }
- } else
- if (scanq->right.queue == NULL) {
- RF_ASSERT(scanq->right.qlen == 0);
- RF_ASSERT(scanq->left.queue);
- req = scanq->left.qtail;
- } else {
- RF_ASSERT(scanq->right.queue);
- RF_ASSERT(scanq->left.queue);
- if (scanq->dir == DIR_RIGHT) {
- req = scanq->right.queue;
- } else {
- req = scanq->left.qtail;
- }
- }
- if (req == NULL) {
- RF_ASSERT(QSUM(scanq) == 0);
- }
- return (req);
-}
-
-RF_DiskQueueData_t *
-rf_CscanPeek(void *qptr)
-{
- RF_DiskQueueData_t *req;
- RF_Sstf_t *cscanq;
-
- cscanq = (RF_Sstf_t *) qptr;
-
- RF_ASSERT(cscanq->dir == DIR_RIGHT);
- if (cscanq->right.queue) {
- req = cscanq->right.queue;
- } else {
- RF_ASSERT(cscanq->right.qlen == 0);
- if (cscanq->left.queue == NULL) {
- RF_ASSERT(cscanq->left.qlen == 0);
- if (cscanq->lopri.queue == NULL) {
- RF_ASSERT(cscanq->lopri.qlen == 0);
- return (NULL);
- }
- req = closest_to_arm(&cscanq->lopri, cscanq->last_sector,
- &cscanq->dir, cscanq->allow_reverse);
- } else {
- /*
- * There's I/Os to the left of the arm. We'll end
- * up swinging on back.
- */
- req = cscanq->left.queue;
- }
- }
- if (req == NULL) {
- RF_ASSERT(QSUM(cscanq) == 0);
- }
- return (req);
-}
-
int
rf_SstfPromote(void *qptr, RF_StripeNum_t parityStripeID, RF_ReconUnitNum_t which_ru)
{
Index: src/sys/dev/raidframe/rf_sstf.h
diff -u src/sys/dev/raidframe/rf_sstf.h:1.5 src/sys/dev/raidframe/rf_sstf.h:1.6
--- src/sys/dev/raidframe/rf_sstf.h:1.5 Sun Dec 11 12:23:37 2005
+++ src/sys/dev/raidframe/rf_sstf.h Fri Jul 23 20:18:24 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_sstf.h,v 1.5 2005/12/11 12:23:37 christos Exp $ */
+/* $NetBSD: rf_sstf.h,v 1.6 2021/07/23 20:18:24 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@@ -57,13 +57,10 @@ rf_CscanCreate(RF_SectorCount_t sect_per
RF_AllocListElem_t * cl_list, RF_ShutdownList_t ** listp);
void rf_SstfEnqueue(void *qptr, RF_DiskQueueData_t * req, int priority);
RF_DiskQueueData_t *rf_SstfDequeue(void *qptr);
-RF_DiskQueueData_t *rf_SstfPeek(void *qptr);
int
rf_SstfPromote(void *qptr, RF_StripeNum_t parityStripeID,
RF_ReconUnitNum_t which_ru);
RF_DiskQueueData_t *rf_ScanDequeue(void *qptr);
-RF_DiskQueueData_t *rf_ScanPeek(void *qptr);
RF_DiskQueueData_t *rf_CscanDequeue(void *qptr);
-RF_DiskQueueData_t *rf_CscanPeek(void *qptr);
#endif /* !_RF__RF_SSTF_H_ */