Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arc/jazz Convert to new device buffer queue interface.



details:   https://anonhg.NetBSD.org/src/rev/f07c764875df
branches:  trunk
changeset: 534654:f07c764875df
user:      hannken <hannken%NetBSD.org@localhost>
date:      Wed Jul 31 18:48:17 2002 +0000

description:
Convert to new device buffer queue interface.

Approved by: Noriyuki Soda <soda%netbsd.org@localhost>

diffstat:

 sys/arch/arc/jazz/fd.c |  18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diffs (83 lines):

diff -r 9766368e34fd -r f07c764875df sys/arch/arc/jazz/fd.c
--- a/sys/arch/arc/jazz/fd.c    Wed Jul 31 17:34:23 2002 +0000
+++ b/sys/arch/arc/jazz/fd.c    Wed Jul 31 18:48:17 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fd.c,v 1.3 2001/07/08 18:06:43 wiz Exp $       */
+/*     $NetBSD: fd.c,v 1.4 2002/07/31 18:48:17 hannken Exp $   */
 /*     $OpenBSD: fd.c,v 1.6 1998/10/03 21:18:57 millert Exp $  */
 /*     NetBSD: fd.c,v 1.78 1995/07/04 07:23:09 mycroft Exp     */
 
@@ -174,7 +174,7 @@
 
        TAILQ_ENTRY(fd_softc) sc_drivechain;
        int sc_ops;             /* I/O ops since last switch */
-       struct buf_queue sc_q;  /* pending I/O requests */
+       struct bufq_state sc_q; /* pending I/O requests */
        int sc_active;          /* number of active I/O operations */
 };
 
@@ -338,7 +338,7 @@
        else
                printf(": density unknown\n");
 
-       BUFQ_INIT(&fd->sc_q);
+       bufq_alloc(&fd->sc_q, BUFQ_DISKSORT|BUFQ_SORT_CYLINDER);
        fd->sc_cylin = -1;
        fd->sc_drive = drive;
        fd->sc_deftype = type;
@@ -456,7 +456,7 @@
 
        /* Queue transfer on drive, activate drive and controller if idle. */
        s = splbio();
-       disksort_cylinder(&fd->sc_q, bp);
+       BUFQ_PUT(&fd->sc_q, bp);
        callout_stop(&fd->sc_motoroff_ch);              /* a good idea */
        if (fd->sc_active == 0)
                fdstart(fd);
@@ -509,17 +509,17 @@
         * another drive is waiting to be serviced, since there is a long motor
         * startup delay whenever we switch.
         */
+       (void)BUFQ_GET(&fd->sc_q);
        if (fd->sc_drivechain.tqe_next && ++fd->sc_ops >= 8) {
                fd->sc_ops = 0;
                TAILQ_REMOVE(&fdc->sc_drives, fd, sc_drivechain);
-               if (BUFQ_NEXT(bp) != NULL)
+               if (BUFQ_PEEK(&fd->sc_q) != NULL)
                        TAILQ_INSERT_TAIL(&fdc->sc_drives, fd, sc_drivechain);
                else
                        fd->sc_active = 0;
        }
        bp->b_resid = fd->sc_bcount;
        fd->sc_skip = 0;
-       BUFQ_REMOVE(&fd->sc_q, bp);
        biodone(bp);
        /* turn off motor 5s from now */
        callout_reset(&fd->sc_motoroff_ch, 5 * hz, fd_motor_off, fd);
@@ -759,7 +759,7 @@
 #endif
        fdcstatus(&fd->sc_dev, 0, "timeout");
 
-       if (BUFQ_FIRST(&fd->sc_q) != NULL)
+       if (BUFQ_PEEK(&fd->sc_q) != NULL)
                fdc->sc_state++;
        else
                fdc->sc_state = DEVIDLE;
@@ -803,7 +803,7 @@
        }
 
        /* Is there a transfer to this drive?  If not, deactivate drive. */
-       bp = BUFQ_FIRST(&fd->sc_q);
+       bp = BUFQ_PEEK(&fd->sc_q);
        if (bp == NULL) {
                fd->sc_ops = 0;
                TAILQ_REMOVE(&fdc->sc_drives, fd, sc_drivechain);
@@ -1052,7 +1052,7 @@
        char bits[64];
 
        fd = fdc->sc_drives.tqh_first;
-       bp = BUFQ_FIRST(&fd->sc_q);
+       bp = BUFQ_PEEK(&fd->sc_q);
 
        switch (fdc->sc_errors) {
        case 0:



Home | Main Index | Thread Index | Old Index