diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2010-04-12 09:51:49 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2010-04-12 09:51:49 +0000 |
commit | 92c48865f5205b2178d91f1d1523d13de2be9d51 (patch) | |
tree | 744445513143bcb041f94961146990f376eda910 /sys/scsi/cd.c | |
parent | b3799e5c1782267f78506c4bd7678e409cfc4c5f (diff) |
i snuck fine grained locking into the midlayer as part of all the
other stuff ive been doing in here. everything that needs protection
inside the midlayer and the scsi device drivers (sd, cd, etc) uses
mutexes now.
this pushes splbio out of the midlayer. splbio is only taken before
biodone is called now.
ok beck@ marco@ krw@ deraadt@. theyre all terrified, but they all
say if we're going to do then now is the right stage of the dev
cycle.
Diffstat (limited to 'sys/scsi/cd.c')
-rw-r--r-- | sys/scsi/cd.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/scsi/cd.c b/sys/scsi/cd.c index b93486e61ab..3f49a9a1e5c 100644 --- a/sys/scsi/cd.c +++ b/sys/scsi/cd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cd.c,v 1.164 2010/02/28 21:17:00 krw Exp $ */ +/* $OpenBSD: cd.c,v 1.165 2010/04/12 09:51:48 dlg Exp $ */ /* $NetBSD: cd.c,v 1.100 1997/04/02 02:29:30 mycroft Exp $ */ /* @@ -683,9 +683,8 @@ cd_buf_done(struct scsi_xfer *xs) { struct cd_softc *sc = xs->sc_link->device_softc; struct buf *bp = xs->cookie; + int s; - splassert(IPL_BIO); - switch (xs->error) { case XS_NOERROR: bp->b_error = 0; @@ -733,7 +732,9 @@ retry: disk_unbusy(&sc->sc_dk, bp->b_bcount - xs->resid, bp->b_flags & B_READ); + s = splbio(); biodone(bp); + splx(s); scsi_xs_put(xs); cdstart(sc); /* restart io */ } |