diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2007-05-06 04:08:48 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2007-05-06 04:08:48 +0000 |
commit | 8e63f77e5396994e8d3763d7bc98a2dbfbce6eb8 (patch) | |
tree | ca0079ab9cc21fbf3e78a4b4e6b251cff59231af | |
parent | 1b2ae2b4f3c14eba0c4feb7613aee2680e95da48 (diff) |
More lockmgr -> rwlock low hanging fruit.
ok dlg@
-rw-r--r-- | sys/dev/usb/if_aue.c | 10 | ||||
-rw-r--r-- | sys/dev/usb/if_auereg.h | 4 | ||||
-rw-r--r-- | sys/dev/usb/if_udav.c | 10 | ||||
-rw-r--r-- | sys/dev/usb/if_udavreg.h | 4 | ||||
-rw-r--r-- | sys/dev/usb/if_url.c | 10 | ||||
-rw-r--r-- | sys/dev/usb/if_urlreg.h | 4 |
6 files changed, 21 insertions, 21 deletions
diff --git a/sys/dev/usb/if_aue.c b/sys/dev/usb/if_aue.c index d17b329e74e..00a5833b376 100644 --- a/sys/dev/usb/if_aue.c +++ b/sys/dev/usb/if_aue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_aue.c,v 1.51 2007/02/23 23:03:04 jsg Exp $ */ +/* $OpenBSD: if_aue.c,v 1.52 2007/05/06 04:08:47 krw Exp $ */ /* $NetBSD: if_aue.c,v 1.82 2003/03/05 17:37:36 shiba Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -82,7 +82,7 @@ #include <sys/param.h> #include <sys/systm.h> #include <sys/sockio.h> -#include <sys/lock.h> +#include <sys/rwlock.h> #include <sys/mbuf.h> #include <sys/malloc.h> #include <sys/kernel.h> @@ -429,13 +429,13 @@ Static void aue_lock_mii(struct aue_softc *sc) { sc->aue_refcnt++; - usb_lockmgr(&sc->aue_mii_lock, LK_EXCLUSIVE, NULL, curproc); + rw_enter_write(&sc->aue_mii_lock); } Static void aue_unlock_mii(struct aue_softc *sc) { - usb_lockmgr(&sc->aue_mii_lock, LK_RELEASE, NULL, curproc); + rw_exit_write(&sc->aue_mii_lock); if (--sc->aue_refcnt < 0) usb_detach_wakeup(USBDEV(sc->aue_dev)); } @@ -744,7 +744,7 @@ USB_ATTACH(aue) usb_init_task(&sc->aue_tick_task, aue_tick_task, sc); usb_init_task(&sc->aue_stop_task, (void (*)(void *))aue_stop, sc); - lockinit(&sc->aue_mii_lock, PZERO, "auemii", 0, 0); + rw_init(&sc->aue_mii_lock, "auemii"); err = usbd_device2interface_handle(dev, AUE_IFACE_IDX, &iface); if (err) { diff --git a/sys/dev/usb/if_auereg.h b/sys/dev/usb/if_auereg.h index 5d11ceb6911..83d7bda4b91 100644 --- a/sys/dev/usb/if_auereg.h +++ b/sys/dev/usb/if_auereg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_auereg.h,v 1.9 2006/05/18 16:46:05 jolan Exp $ */ +/* $OpenBSD: if_auereg.h,v 1.10 2007/05/06 04:08:47 krw Exp $ */ /* $NetBSD: if_auereg.h,v 1.16 2001/10/10 02:14:17 augustss Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -268,7 +268,7 @@ struct aue_softc { struct usb_task aue_tick_task; struct usb_task aue_stop_task; - struct lock aue_mii_lock; + struct rwlock aue_mii_lock; void *sc_sdhook; }; diff --git a/sys/dev/usb/if_udav.c b/sys/dev/usb/if_udav.c index 23268c93d32..e01014b56ef 100644 --- a/sys/dev/usb/if_udav.c +++ b/sys/dev/usb/if_udav.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_udav.c,v 1.21 2007/04/16 09:13:41 jsg Exp $ */ +/* $OpenBSD: if_udav.c,v 1.22 2007/05/06 04:08:47 krw Exp $ */ /* $NetBSD: if_udav.c,v 1.3 2004/04/23 17:25:25 itojun Exp $ */ /* $nabe: if_udav.c,v 1.3 2003/08/21 16:57:19 nabe Exp $ */ /* @@ -50,7 +50,7 @@ #include <sys/param.h> #include <sys/systm.h> -#include <sys/lock.h> +#include <sys/rwlock.h> #include <sys/mbuf.h> #include <sys/kernel.h> #include <sys/proc.h> @@ -196,7 +196,7 @@ USB_ATTACH(udav) } usb_init_task(&sc->sc_tick_task, udav_tick_task, sc); - lockinit(&sc->sc_mii_lock, PZERO, "udavmii", 0, 0); + rw_init(&sc->sc_mii_lock, "udavmii"); usb_init_task(&sc->sc_stop_task, (void (*)(void *)) udav_stop_task, sc); /* get control interface */ @@ -1495,7 +1495,7 @@ udav_lock_mii(struct udav_softc *sc) __func__)); sc->sc_refcnt++; - usb_lockmgr(&sc->sc_mii_lock, LK_EXCLUSIVE, NULL, curproc); + rw_enter_write(&sc->sc_mii_lock); } Static void @@ -1504,7 +1504,7 @@ udav_unlock_mii(struct udav_softc *sc) DPRINTFN(0xff, ("%s: %s: enter\n", USBDEVNAME(sc->sc_dev), __func__)); - usb_lockmgr(&sc->sc_mii_lock, LK_RELEASE, NULL, curproc); + rw_exit_write(&sc->sc_mii_lock); if (--sc->sc_refcnt < 0) usb_detach_wakeup(USBDEV(sc->sc_dev)); } diff --git a/sys/dev/usb/if_udavreg.h b/sys/dev/usb/if_udavreg.h index e1222104d0f..8daa20cba60 100644 --- a/sys/dev/usb/if_udavreg.h +++ b/sys/dev/usb/if_udavreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_udavreg.h,v 1.4 2006/03/07 04:41:19 krw Exp $ */ +/* $OpenBSD: if_udavreg.h,v 1.5 2007/05/06 04:08:47 krw Exp $ */ /* $NetBSD: if_udavreg.h,v 1.2 2003/09/04 15:17:39 tsutsui Exp $ */ /* $nabe: if_udavreg.h,v 1.2 2003/08/21 16:26:40 nabe Exp $ */ /* @@ -188,7 +188,7 @@ struct udav_softc { struct arpcom sc_ac; /* ethernet common */ #endif struct mii_data sc_mii; - struct lock sc_mii_lock; + struct rwlock sc_mii_lock; int sc_link; #define sc_media udav_mii.mii_media struct udav_cdata sc_cdata; diff --git a/sys/dev/usb/if_url.c b/sys/dev/usb/if_url.c index 301beb72621..143bfd12ff5 100644 --- a/sys/dev/usb/if_url.c +++ b/sys/dev/usb/if_url.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_url.c,v 1.34 2007/02/11 20:29:22 miod Exp $ */ +/* $OpenBSD: if_url.c,v 1.35 2007/05/06 04:08:47 krw Exp $ */ /* $NetBSD: if_url.c,v 1.6 2002/09/29 10:19:21 martin Exp $ */ /* * Copyright (c) 2001, 2002 @@ -47,7 +47,7 @@ #include <sys/param.h> #include <sys/systm.h> -#include <sys/lock.h> +#include <sys/rwlock.h> #include <sys/mbuf.h> #include <sys/kernel.h> #if defined(__OpenBSD__) @@ -210,7 +210,7 @@ USB_ATTACH(url) } usb_init_task(&sc->sc_tick_task, url_tick_task, sc); - lockinit(&sc->sc_mii_lock, PZERO, "urlmii", 0, 0); + rw_init(&sc->sc_mii_lock, "urlmii"); usb_init_task(&sc->sc_stop_task, (void (*)(void *)) url_stop_task, sc); /* get control interface */ @@ -1405,7 +1405,7 @@ url_lock_mii(struct url_softc *sc) __func__)); sc->sc_refcnt++; - usb_lockmgr(&sc->sc_mii_lock, LK_EXCLUSIVE, NULL, curproc); + rw_enter_write(&sc->sc_mii_lock); } Static void @@ -1414,7 +1414,7 @@ url_unlock_mii(struct url_softc *sc) DPRINTFN(0xff, ("%s: %s: enter\n", USBDEVNAME(sc->sc_dev), __func__)); - usb_lockmgr(&sc->sc_mii_lock, LK_RELEASE, NULL, curproc); + rw_exit_write(&sc->sc_mii_lock); if (--sc->sc_refcnt < 0) usb_detach_wakeup(USBDEV(sc->sc_dev)); } diff --git a/sys/dev/usb/if_urlreg.h b/sys/dev/usb/if_urlreg.h index 650d7550476..b90238834b5 100644 --- a/sys/dev/usb/if_urlreg.h +++ b/sys/dev/usb/if_urlreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_urlreg.h,v 1.7 2006/03/07 04:41:19 krw Exp $ */ +/* $OpenBSD: if_urlreg.h,v 1.8 2007/05/06 04:08:47 krw Exp $ */ /* $NetBSD: if_urlreg.h,v 1.1 2002/03/28 21:09:11 ichiro Exp $ */ /* * Copyright (c) 2001, 2002 @@ -178,7 +178,7 @@ struct url_softc { struct arpcom sc_ac; /* ethernet common */ #endif struct mii_data sc_mii; - struct lock sc_mii_lock; + struct rwlock sc_mii_lock; int sc_link; #define sc_media url_mii.mii_media struct url_cdata sc_cdata; |