summaryrefslogtreecommitdiff
path: root/sys/scsi
diff options
context:
space:
mode:
Diffstat (limited to 'sys/scsi')
-rw-r--r--sys/scsi/cd.c6
-rw-r--r--sys/scsi/sd.c6
2 files changed, 10 insertions, 2 deletions
diff --git a/sys/scsi/cd.c b/sys/scsi/cd.c
index 49ab9d6f73b..2ea0cbddcef 100644
--- a/sys/scsi/cd.c
+++ b/sys/scsi/cd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cd.c,v 1.158 2010/01/09 21:12:06 dlg Exp $ */
+/* $OpenBSD: cd.c,v 1.159 2010/01/11 00:44:40 krw Exp $ */
/* $NetBSD: cd.c,v 1.100 1997/04/02 02:29:30 mycroft Exp $ */
/*
@@ -561,6 +561,8 @@ cd_buf_dequeue(struct cd_softc *sc)
bp = sc->sc_buf_queue.b_actf;
if (bp != NULL)
sc->sc_buf_queue.b_actf = bp->b_actf;
+ if (sc->sc_buf_queue.b_actf == NULL)
+ sc->sc_buf_queue.b_actb = &sc->sc_buf_queue.b_actf;
mtx_leave(&sc->sc_queue_mtx);
return (bp);
@@ -572,6 +574,8 @@ cd_buf_requeue(struct cd_softc *sc, struct buf *bp)
mtx_enter(&sc->sc_queue_mtx);
bp->b_actf = sc->sc_buf_queue.b_actf;
sc->sc_buf_queue.b_actf = bp;
+ if (bp->b_actf == NULL)
+ sc->sc_buf_queue.b_actb = &bp->b_actf;
mtx_leave(&sc->sc_queue_mtx);
}
diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c
index 08a398c319c..59ef8378445 100644
--- a/sys/scsi/sd.c
+++ b/sys/scsi/sd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sd.c,v 1.177 2010/01/11 00:14:52 beck Exp $ */
+/* $OpenBSD: sd.c,v 1.178 2010/01/11 00:44:40 krw Exp $ */
/* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */
/*-
@@ -600,6 +600,8 @@ sd_buf_dequeue(struct sd_softc *sc)
bp = sc->sc_buf_queue.b_actf;
if (bp != NULL)
sc->sc_buf_queue.b_actf = bp->b_actf;
+ if (sc->sc_buf_queue.b_actf == NULL)
+ sc->sc_buf_queue.b_actb = &sc->sc_buf_queue.b_actf;
mtx_leave(&sc->sc_buf_mtx);
return (bp);
@@ -611,6 +613,8 @@ sd_buf_requeue(struct sd_softc *sc, struct buf *bp)
mtx_enter(&sc->sc_buf_mtx);
bp->b_actf = sc->sc_buf_queue.b_actf;
sc->sc_buf_queue.b_actf = bp;
+ if (bp->b_actf == NULL)
+ sc->sc_buf_queue.b_actb = &bp->b_actf;
mtx_leave(&sc->sc_buf_mtx);
}