summaryrefslogtreecommitdiff
path: root/sys/kern/subr_disk.c
diff options
context:
space:
mode:
authorMatthew Dempsky <matthew@cvs.openbsd.org>2011-06-19 04:53:18 +0000
committerMatthew Dempsky <matthew@cvs.openbsd.org>2011-06-19 04:53:18 +0000
commita809e4c7b624b56c125ce1320f4ad1bc5958112b (patch)
tree9a3d9516fa72e53ff76aeab524ea3fdab45f7aa9 /sys/kern/subr_disk.c
parent30d542e360185d6a6636b094086b49d79ae6ed7c (diff)
Minor cleanup for disk_lock() and disk_unlock().
ok deraadt@
Diffstat (limited to 'sys/kern/subr_disk.c')
-rw-r--r--sys/kern/subr_disk.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c
index f9f7c9e0a14..2ddf1747d95 100644
--- a/sys/kern/subr_disk.c
+++ b/sys/kern/subr_disk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_disk.c,v 1.125 2011/06/19 04:51:06 matthew Exp $ */
+/* $OpenBSD: subr_disk.c,v 1.126 2011/06/19 04:53:17 matthew Exp $ */
/* $NetBSD: subr_disk.c,v 1.17 1996/03/16 23:17:08 christos Exp $ */
/*
@@ -953,11 +953,7 @@ disk_unbusy(struct disk *diskp, long bcount, int read)
int
disk_lock(struct disk *dk)
{
- int error;
-
- error = rw_enter(&dk->dk_lock, RW_WRITE|RW_INTR);
-
- return (error);
+ return (rw_enter(&dk->dk_lock, RW_WRITE|RW_INTR));
}
void
@@ -969,7 +965,7 @@ disk_lock_nointr(struct disk *dk)
void
disk_unlock(struct disk *dk)
{
- rw_exit(&dk->dk_lock);
+ rw_exit_write(&dk->dk_lock);
}
int