Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/acorn32/mainbus Convert to new device buffer queue ...
details: https://anonhg.NetBSD.org/src/rev/57b84749789b
branches: trunk
changeset: 534466:57b84749789b
user: hannken <hannken%NetBSD.org@localhost>
date: Sat Jul 27 11:09:35 2002 +0000
description:
Convert to new device buffer queue interface.
Approved by: Reinoud Zandijk <reinoud%netbsd.org@localhost>
diffstat:
sys/arch/acorn32/mainbus/fd.c | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diffs (83 lines):
diff -r 4d56bdba5716 -r 57b84749789b sys/arch/acorn32/mainbus/fd.c
--- a/sys/arch/acorn32/mainbus/fd.c Sat Jul 27 11:07:35 2002 +0000
+++ b/sys/arch/acorn32/mainbus/fd.c Sat Jul 27 11:09:35 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fd.c,v 1.4 2001/12/20 01:20:21 thorpej Exp $ */
+/* $NetBSD: fd.c,v 1.5 2002/07/27 11:09:35 hannken Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -253,7 +253,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 */
};
@@ -498,7 +498,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;
@@ -602,7 +602,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);
@@ -655,17 +655,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 */
@@ -910,7 +910,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;
@@ -955,7 +955,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);
@@ -1255,7 +1255,7 @@
struct buf *bp;
fd = fdc->sc_drives.tqh_first;
- bp = BUFQ_FIRST(&fd->sc_q);
+ bp = BUFQ_PEEK(&fd->sc_q);
if (fd->sc_opts & FDOPT_NORETRY)
goto fail;
Home |
Main Index |
Thread Index |
Old Index