summaryrefslogtreecommitdiff
path: root/sys/uvm/uvm_swap.c
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2007-01-12 07:41:32 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2007-01-12 07:41:32 +0000
commit7593f02e4f7b8079418c1d55eb0037a92bb9c6b7 (patch)
tree4a8421b7a605d0268b8ea91158e639d87939c9c9 /sys/uvm/uvm_swap.c
parent5338627e554387cb23ac3993d4113a6d0a01c506 (diff)
Switch some lockmgr locks to rwlocks.
In this commit: - gdt lock on amd64 - sysctl lock - malloc sysctl lock - disk sysctl lock - swap syscall lock miod@, pedro@ ok (and "looks good" others@)
Diffstat (limited to 'sys/uvm/uvm_swap.c')
-rw-r--r--sys/uvm/uvm_swap.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/uvm/uvm_swap.c b/sys/uvm/uvm_swap.c
index 27548b8cb95..ffdaf3b2025 100644
--- a/sys/uvm/uvm_swap.c
+++ b/sys/uvm/uvm_swap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_swap.c,v 1.66 2006/10/03 19:49:06 pedro Exp $ */
+/* $OpenBSD: uvm_swap.c,v 1.67 2007/01/12 07:41:31 art Exp $ */
/* $NetBSD: uvm_swap.c,v 1.40 2000/11/17 11:39:39 mrg Exp $ */
/*
@@ -227,7 +227,7 @@ LIST_HEAD(swap_priority, swappri);
static struct swap_priority swap_priority;
/* locks */
-lock_data_t swap_syscall_lock;
+struct rwlock swap_syscall_lock = RWLOCK_INITIALIZER;
/*
* prototypes
@@ -279,7 +279,6 @@ uvm_swap_init()
LIST_INIT(&swap_priority);
uvmexp.nswapdev = 0;
- lockinit(&swap_syscall_lock, PVM, "swapsys", 0, 0);
simple_lock_init(&uvm.swap_data_lock);
if (!swapdev_vp && bdevvp(swapdev, &swapdev_vp))
@@ -638,7 +637,7 @@ sys_swapctl(p, v, retval)
/*
* ensure serialized syscall access by grabbing the swap_syscall_lock
*/
- lockmgr(&swap_syscall_lock, LK_EXCLUSIVE, NULL);
+ rw_enter_write(&swap_syscall_lock);
/*
* we handle the non-priv NSWAP and STATS request first.
@@ -877,7 +876,7 @@ sys_swapctl(p, v, retval)
vput(vp);
out:
- lockmgr(&swap_syscall_lock, LK_RELEASE, NULL);
+ rw_exit_write(&swap_syscall_lock);
UVMHIST_LOG(pdhist, "<- done! error=%ld", error, 0, 0, 0);
return (error);