diff options
Diffstat (limited to 'sys/kern/subr_disk.c')
-rw-r--r-- | sys/kern/subr_disk.c | 9 |
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); } /* |