summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2007-03-30 00:38:57 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2007-03-30 00:38:57 +0000
commit66db9b99ad3aab37a6573213a76f34f254c167d3 (patch)
treeb24a2aa62824b067aa11b2b56bd525936691cd64 /sys/kern
parent301cac1db0dca8870ea9f3cb23e47b2bd8082a8f (diff)
replace lockmgr locks with rwlocks. these are no longer recursive, but they
weren't used recursively anyway. tested by hsoexer@ fkr@ ok pedro@
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/subr_disk.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c
index c44d80def42..9f42ca832fd 100644
--- a/sys/kern/subr_disk.c
+++ b/sys/kern/subr_disk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_disk.c,v 1.33 2007/03/27 18:04:01 thib Exp $ */
+/* $OpenBSD: subr_disk.c,v 1.34 2007/03/30 00:38:56 dlg Exp $ */
/* $NetBSD: subr_disk.c,v 1.17 1996/03/16 23:17:08 christos Exp $ */
/*
@@ -261,8 +261,7 @@ disk_find(char *name)
int
disk_construct(struct disk *diskp, char *lockname)
{
- lockinit(&diskp->dk_lock, PRIBIO | PCATCH, lockname,
- 0, LK_CANRECURSE);
+ rw_init(&diskp->dk_lock, lockname);
diskp->dk_flags |= DKF_CONSTRUCTED;
@@ -382,7 +381,7 @@ disk_lock(struct disk *dk)
{
int error;
- error = lockmgr(&dk->dk_lock, LK_EXCLUSIVE, NULL);
+ error = rw_enter(&dk->dk_lock, RW_WRITE|RW_INTR);
return (error);
}
@@ -390,7 +389,7 @@ disk_lock(struct disk *dk)
void
disk_unlock(struct disk *dk)
{
- lockmgr(&dk->dk_lock, LK_RELEASE, NULL);
+ rw_exit(&dk->dk_lock);
}
/*