diff options
author | Matthew Dempsky <matthew@cvs.openbsd.org> | 2011-06-20 06:45:08 +0000 |
---|---|---|
committer | Matthew Dempsky <matthew@cvs.openbsd.org> | 2011-06-20 06:45:08 +0000 |
commit | cf44581f2216d1fe7c6919050a139d5d3bab2f7e (patch) | |
tree | d75e277a531d36f7f4962992f1970b27ddd3942b /sys | |
parent | 8dbf59ffeb2572abb6fe13d86f48371fe51b8ffb (diff) |
Call bufq_drain() in wddetach() instead of reimplementing the same
logic.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ata/wd.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/sys/dev/ata/wd.c b/sys/dev/ata/wd.c index d5e95cb6295..953a9a6ea89 100644 --- a/sys/dev/ata/wd.c +++ b/sys/dev/ata/wd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wd.c,v 1.105 2011/06/19 04:55:34 deraadt Exp $ */ +/* $OpenBSD: wd.c,v 1.106 2011/06/20 06:45:07 matthew Exp $ */ /* $NetBSD: wd.c,v 1.193 1999/02/28 17:15:27 explorer Exp $ */ /* @@ -370,19 +370,11 @@ int wddetach(struct device *self, int flags) { struct wd_softc *sc = (struct wd_softc *)self; - struct buf *bp; - int s, bmaj, cmaj, mn; + int bmaj, cmaj, mn; timeout_del(&sc->sc_restart_timeout); - /* Remove unprocessed buffers from queue */ - s = splbio(); - while ((bp = bufq_dequeue(&sc->sc_bufq)) != NULL) { - bp->b_error = ENXIO; - bp->b_flags |= B_ERROR; - biodone(bp); - } - splx(s); + bufq_drain(&sc->sc_bufq); /* Locate the lowest minor number to be detached. */ mn = DISKMINOR(self->dv_unit, 0); |