Source-Changes-HG archive

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

[src/trunk]: src/sys/dev Convert to new device buffer queue interface.



details:   https://anonhg.NetBSD.org/src/rev/a08aaf17013d
branches:  trunk
changeset: 534296:a08aaf17013d
user:      hannken <hannken%NetBSD.org@localhost>
date:      Sat Jul 20 16:30:18 2002 +0000

description:
Convert to new device buffer queue interface.

diffstat:

 sys/dev/mca/ed_mca.c               |   8 ++++----
 sys/dev/mca/edc_mca.c              |   7 +++----
 sys/dev/mca/edvar.h                |   4 ++--
 sys/dev/raidframe/rf_netbsdkintf.c |  13 ++++++-------
 4 files changed, 15 insertions(+), 17 deletions(-)

diffs (144 lines):

diff -r 3046633ae173 -r a08aaf17013d sys/dev/mca/ed_mca.c
--- a/sys/dev/mca/ed_mca.c      Sat Jul 20 14:18:45 2002 +0000
+++ b/sys/dev/mca/ed_mca.c      Sat Jul 20 16:30:18 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ed_mca.c,v 1.11 2002/03/29 20:10:46 jdolecek Exp $     */
+/*     $NetBSD: ed_mca.c,v 1.12 2002/07/20 16:30:18 hannken Exp $      */
 
 /*
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ed_mca.c,v 1.11 2002/03/29 20:10:46 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ed_mca.c,v 1.12 2002/07/20 16:30:18 hannken Exp $");
 
 #include "rnd.h"
 #include "locators.h"
@@ -150,7 +150,7 @@
        ed->sc_devno  = eda->edc_drive;
        edc_add_disk(sc, ed);
 
-       BUFQ_INIT(&ed->sc_q);
+       bufq_init(&ed->sc_q, BUFQ_DISKSORT|BUFQ_SORT_RAWBLOCK);
        simple_lock_init(&ed->sc_q_lock);
        snprintf(lckname, sizeof(lckname), "%slck", ed->sc_dev.dv_xname);
        lockinit(&ed->sc_lock, PRIBIO | PCATCH, lckname, 0, 0);
@@ -248,7 +248,7 @@
 
        /* Queue transfer on drive, activate drive and controller if idle. */
        simple_lock(&ed->sc_q_lock);
-       disksort_blkno(&ed->sc_q, bp);
+       BUFQ_PUT(&ed->sc_q, bp);
        simple_unlock(&ed->sc_q_lock);
 
        /* Ring the worker thread */
diff -r 3046633ae173 -r a08aaf17013d sys/dev/mca/edc_mca.c
--- a/sys/dev/mca/edc_mca.c     Sat Jul 20 14:18:45 2002 +0000
+++ b/sys/dev/mca/edc_mca.c     Sat Jul 20 16:30:18 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: edc_mca.c,v 1.16 2002/03/31 10:01:26 jdolecek Exp $    */
+/*     $NetBSD: edc_mca.c,v 1.17 2002/07/20 16:30:19 hannken Exp $     */
 
 /*
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -50,7 +50,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: edc_mca.c,v 1.16 2002/03/31 10:01:26 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: edc_mca.c,v 1.17 2002/07/20 16:30:19 hannken Exp $");
 
 #include "rnd.h"
 
@@ -855,12 +855,11 @@
 
                        /* Is there a buf for us ? */
                        simple_lock(&ed->sc_q_lock);
-                       if ((bp = BUFQ_FIRST(&ed->sc_q)) == NULL) {
+                       if ((bp = BUFQ_GET(&ed->sc_q)) == NULL) {
                                simple_unlock(&ed->sc_q_lock);
                                i++;
                                continue;
                        }
-                       BUFQ_REMOVE(&ed->sc_q, bp);
                        simple_unlock(&ed->sc_q_lock);
 
                        /* Instrumentation. */
diff -r 3046633ae173 -r a08aaf17013d sys/dev/mca/edvar.h
--- a/sys/dev/mca/edvar.h       Sat Jul 20 14:18:45 2002 +0000
+++ b/sys/dev/mca/edvar.h       Sat Jul 20 16:30:18 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: edvar.h,v 1.6 2001/11/24 12:46:15 jdolecek Exp $       */
+/*     $NetBSD: edvar.h,v 1.7 2002/07/20 16:30:19 hannken Exp $        */
 
 /*
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
 
        /* General disk infos */
        struct disk sc_dk;
-       struct buf_queue sc_q;
+       struct bufq_state sc_q;
        struct simplelock sc_q_lock;
 
        struct edc_mca_softc *edc_softc;   /* pointer to our controller */
diff -r 3046633ae173 -r a08aaf17013d sys/dev/raidframe/rf_netbsdkintf.c
--- a/sys/dev/raidframe/rf_netbsdkintf.c        Sat Jul 20 14:18:45 2002 +0000
+++ b/sys/dev/raidframe/rf_netbsdkintf.c        Sat Jul 20 16:30:18 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_netbsdkintf.c,v 1.124 2002/07/13 17:47:44 oster Exp $       */
+/*     $NetBSD: rf_netbsdkintf.c,v 1.125 2002/07/20 16:34:15 hannken Exp $     */
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -114,7 +114,7 @@
  ***********************************************************/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.124 2002/07/13 17:47:44 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.125 2002/07/20 16:34:15 hannken Exp $");
 
 #include <sys/param.h>
 #include <sys/errno.h>
@@ -219,7 +219,7 @@
        size_t  sc_size;        /* size of the raid device */
        char    sc_xname[20];   /* XXX external name */
        struct disk sc_dkdev;   /* generic disk device info */
-       struct buf_queue buf_queue;     /* used for the device queue */
+       struct bufq_state buf_queue;    /* used for the device queue */
 };
 /* sc_flags */
 #define RAIDF_INITED   0x01    /* unit has been initialized */
@@ -366,7 +366,7 @@
        }
 
        for (raidID = 0; raidID < num; raidID++) {
-               BUFQ_INIT(&raid_softc[raidID].buf_queue);
+               bufq_init(&raid_softc[raidID].buf_queue, BUFQ_FCFS);
 
                raidrootdev[raidID].dv_class  = DV_DISK;
                raidrootdev[raidID].dv_cfdata = NULL;
@@ -715,7 +715,7 @@
        bp->b_resid = 0;
 
        /* stuff it onto our queue */
-       BUFQ_INSERT_TAIL(&rs->buf_queue, bp);
+       BUFQ_PUT(&rs->buf_queue, bp);
 
        raidstart(raidPtrs[raidID]);
 
@@ -1664,11 +1664,10 @@
                RF_UNLOCK_MUTEX(raidPtr->mutex);
 
                /* get the next item, if any, from the queue */
-               if ((bp = BUFQ_FIRST(&rs->buf_queue)) == NULL) {
+               if ((bp = BUFQ_GET(&rs->buf_queue)) == NULL) {
                        /* nothing more to do */
                        return;
                }
-               BUFQ_REMOVE(&rs->buf_queue, bp);
 
                /* Ok, for the bp we have here, bp->b_blkno is relative to the
                 * partition.. Need to make it absolute to the underlying 



Home | Main Index | Thread Index | Old Index