Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/raidframe Various disk queue "peek" routines were on...



details:   https://anonhg.NetBSD.org/src/rev/02d458342e35
branches:  trunk
changeset: 1022517:02d458342e35
user:      oster <oster%NetBSD.org@localhost>
date:      Fri Jul 23 20:18:24 2021 +0000

description:
Various disk queue "peek" routines were only ever used in the simulator
version of RAIDFrame.  Remove them from here.

diffstat:

 sys/dev/raidframe/rf_diskqueue.c |   19 ++----
 sys/dev/raidframe/rf_diskqueue.h |    3 +-
 sys/dev/raidframe/rf_fifo.c      |   21 +------
 sys/dev/raidframe/rf_fifo.h      |    3 +-
 sys/dev/raidframe/rf_sstf.c      |  115 +--------------------------------------
 sys/dev/raidframe/rf_sstf.h      |    5 +-
 6 files changed, 14 insertions(+), 152 deletions(-)

diffs (295 lines):

diff -r babc0ca62b4e -r 02d458342e35 sys/dev/raidframe/rf_diskqueue.c
--- a/sys/dev/raidframe/rf_diskqueue.c  Fri Jul 23 17:06:37 2021 +0000
+++ b/sys/dev/raidframe/rf_diskqueue.c  Fri Jul 23 20:18:24 2021 +0000
@@ -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 @@
                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))
diff -r babc0ca62b4e -r 02d458342e35 sys/dev/raidframe/rf_diskqueue.h
--- a/sys/dev/raidframe/rf_diskqueue.h  Fri Jul 23 17:06:37 2021 +0000
+++ b/sys/dev/raidframe/rf_diskqueue.h  Fri Jul 23 20:18:24 2021 +0000
@@ -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 @@
                                                                                                 * 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 */
diff -r babc0ca62b4e -r 02d458342e35 sys/dev/raidframe/rf_fifo.c
--- a/sys/dev/raidframe/rf_fifo.c       Fri Jul 23 17:06:37 2021 +0000
+++ b/sys/dev/raidframe/rf_fifo.c       Fri Jul 23 20:18:24 2021 +0000
@@ -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 @@
        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.
diff -r babc0ca62b4e -r 02d458342e35 sys/dev/raidframe/rf_fifo.h
--- a/sys/dev/raidframe/rf_fifo.h       Fri Jul 23 17:06:37 2021 +0000
+++ b/sys/dev/raidframe/rf_fifo.h       Fri Jul 23 20:18:24 2021 +0000
@@ -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 @@
 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);
diff -r babc0ca62b4e -r 02d458342e35 sys/dev/raidframe/rf_sstf.c
--- a/sys/dev/raidframe/rf_sstf.c       Fri Jul 23 17:06:37 2021 +0000
+++ b/sys/dev/raidframe/rf_sstf.c       Fri Jul 23 20:18:24 2021 +0000
@@ -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 @@
        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)
 {
diff -r babc0ca62b4e -r 02d458342e35 sys/dev/raidframe/rf_sstf.h
--- a/sys/dev/raidframe/rf_sstf.h       Fri Jul 23 17:06:37 2021 +0000
+++ b/sys/dev/raidframe/rf_sstf.h       Fri Jul 23 20:18:24 2021 +0000
@@ -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_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_ */



Home | Main Index | Thread Index | Old Index