Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/efc7fe5f53f6
branches:  trunk
changeset: 534668:efc7fe5f53f6
user:      hannken <hannken%NetBSD.org@localhost>
date:      Thu Aug 01 12:45:20 2002 +0000

description:
Convert to new device buffer queue interface.

Approved by: NISHIMURA Takeshi <nsmrtks%netbsd.org@localhost>

diffstat:

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

diffs (83 lines):

diff -r 076c428d7cea -r efc7fe5f53f6 sys/arch/x68k/dev/fd.c
--- a/sys/arch/x68k/dev/fd.c    Thu Aug 01 09:43:16 2002 +0000
+++ b/sys/arch/x68k/dev/fd.c    Thu Aug 01 12:45:20 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fd.c,v 1.41 2002/07/31 11:01:26 isaki Exp $    */
+/*     $NetBSD: fd.c,v 1.42 2002/08/01 12:45:20 hannken Exp $  */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -246,7 +246,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 */
        u_char *sc_copybuf;     /* for secsize >=3 */
        u_char sc_part;         /* for secsize >=3 */
@@ -596,7 +596,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;
@@ -688,7 +688,7 @@
                 bp->b_blkno, bp->b_bcount, bp->b_cylinder));
        /* 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);
@@ -740,17 +740,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);
 
 #if NRND > 0
        rnd_add_uint32(&fd->rnd_source, bp->b_blkno);
@@ -1033,7 +1033,7 @@
        s = splbio();
        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;
@@ -1091,7 +1091,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);
@@ -1493,7 +1493,7 @@
 
        DPRINTF(("fdcretry:\n"));
        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