Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sparc/dev Convert to new device buffer queue interf...
details: https://anonhg.NetBSD.org/src/rev/fa207803d8d1
branches: trunk
changeset: 534923:fa207803d8d1
user: hannken <hannken%NetBSD.org@localhost>
date: Tue Aug 06 14:44:15 2002 +0000
description:
Convert to new device buffer queue interface.
Approved by: Paul Kranenburg <pk%netbsd.org@localhost>
diffstat:
sys/arch/sparc/dev/fd.c | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diffs (83 lines):
diff -r 823062e91f64 -r fa207803d8d1 sys/arch/sparc/dev/fd.c
--- a/sys/arch/sparc/dev/fd.c Tue Aug 06 14:00:03 2002 +0000
+++ b/sys/arch/sparc/dev/fd.c Tue Aug 06 14:44:15 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fd.c,v 1.89 2002/03/11 16:27:02 pk Exp $ */
+/* $NetBSD: fd.c,v 1.90 2002/08/06 14:44:15 hannken Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -255,7 +255,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 requests */
};
@@ -766,7 +766,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;
@@ -861,7 +861,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);
@@ -913,17 +913,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 */
@@ -1260,7 +1260,7 @@
goto out;
}
- if (BUFQ_FIRST(&fd->sc_q) != NULL)
+ if (BUFQ_PEEK(&fd->sc_q) != NULL)
fdc->sc_state++;
else
fdc->sc_state = DEVIDLE;
@@ -1429,7 +1429,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);
@@ -1804,7 +1804,7 @@
int error = EIO;
fd = fdc->sc_drives.tqh_first;
- bp = BUFQ_FIRST(&fd->sc_q);
+ bp = BUFQ_PEEK(&fd->sc_q);
fdc->sc_overruns = 0;
if (fd->sc_opts & FDOPT_NORETRY)
Home |
Main Index |
Thread Index |
Old Index