summaryrefslogtreecommitdiff
path: root/sys/dev/i2o/iopsp.c
diff options
context:
space:
mode:
authorOwain Ainsworth <oga@cvs.openbsd.org>2009-04-02 18:44:50 +0000
committerOwain Ainsworth <oga@cvs.openbsd.org>2009-04-02 18:44:50 +0000
commiteb363815d95c12d5528801b61a547ec17268e147 (patch)
treebf46300d00f5d0c6fb0b5cb80d6f3fc164d87c6e /sys/dev/i2o/iopsp.c
parent18d68267be9932247dfd19a353d4bc8116423f9d (diff)
Convert lockmgr to rwlock. Fixing a (harmless) lock leak on attach
failure while i'm at it. Been in snaps for a while. ok deraadt@
Diffstat (limited to 'sys/dev/i2o/iopsp.c')
-rw-r--r--sys/dev/i2o/iopsp.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/sys/dev/i2o/iopsp.c b/sys/dev/i2o/iopsp.c
index 3db66922fb6..3cfb91b3a3b 100644
--- a/sys/dev/i2o/iopsp.c
+++ b/sys/dev/i2o/iopsp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: iopsp.c,v 1.14 2009/02/16 21:19:06 miod Exp $ */
+/* $OpenBSD: iopsp.c,v 1.15 2009/04/02 18:44:49 oga Exp $ */
/* $NetBSD$ */
/*-
@@ -45,7 +45,7 @@
#include <sys/endian.h>
#include <sys/malloc.h>
#include <sys/scsiio.h>
-#include <sys/lock.h>
+#include <sys/rwlock.h>
#include <machine/bus.h>
@@ -371,13 +371,7 @@ iopsp_rescan(struct iopsp_softc *sc)
iop = (struct iop_softc *)sc->sc_dv.dv_parent;
- rv = lockmgr(&iop->sc_conflock, LK_EXCLUSIVE, NULL);
- if (rv != 0) {
-#ifdef I2ODEBUG
- printf("iopsp_rescan: unable to acquire lock\n");
-#endif
- return (rv);
- }
+ rw_enter_write(&iop->sc_conflock);
im = iop_msg_alloc(iop, &sc->sc_ii, IM_WAIT);
@@ -395,7 +389,7 @@ iopsp_rescan(struct iopsp_softc *sc)
if ((rv = iop_lct_get(iop)) == 0)
rv = iopsp_reconfig(&sc->sc_dv);
- lockmgr(&iop->sc_conflock, LK_RELEASE, NULL);
+ rw_exit_write(&iop->sc_conflock);
return (rv);
}