summaryrefslogtreecommitdiff
path: root/sys/uvm
diff options
context:
space:
mode:
authorPedro Martelletto <pedro@cvs.openbsd.org>2005-11-19 02:18:03 +0000
committerPedro Martelletto <pedro@cvs.openbsd.org>2005-11-19 02:18:03 +0000
commit4e00bfe9e4fce563a74dcd487149539b6bc02ba9 (patch)
treea134970c4687287588758bb78c439e9cde819bb9 /sys/uvm
parent16017b33d1fad6b6fd295f39b365b33719b42ae9 (diff)
Remove unnecessary lockmgr() archaism that was costing too much in terms
of panics and bugfixes. Access curproc directly, do not expect a process pointer as an argument. Should fix many "process context required" bugs. Incentive and okay millert@, okay marc@. Various testing, thanks.
Diffstat (limited to 'sys/uvm')
-rw-r--r--sys/uvm/uvm_map.h20
-rw-r--r--sys/uvm/uvm_swap.c6
-rw-r--r--sys/uvm/uvm_vnode.c6
3 files changed, 16 insertions, 16 deletions
diff --git a/sys/uvm/uvm_map.h b/sys/uvm/uvm_map.h
index e729e609300..2db836338b3 100644
--- a/sys/uvm/uvm_map.h
+++ b/sys/uvm/uvm_map.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_map.h,v 1.33 2005/09/30 02:42:57 brad Exp $ */
+/* $OpenBSD: uvm_map.h,v 1.34 2005/11/19 02:18:02 pedro Exp $ */
/* $NetBSD: uvm_map.h,v 1.24 2001/02/18 21:19:08 chs Exp $ */
/*
@@ -410,7 +410,7 @@ vm_map_lock_try(map)
return (FALSE);
}
rv = (lockmgr(&map->lock, LK_EXCLUSIVE|LK_NOWAIT|LK_INTERLOCK,
- &map->flags_lock, curproc) == 0);
+ &map->flags_lock) == 0);
}
if (rv)
@@ -438,7 +438,7 @@ vm_map_lock(map)
}
error = lockmgr(&map->lock, LK_EXCLUSIVE|LK_SLEEPFAIL|LK_INTERLOCK,
- &map->flags_lock, curproc);
+ &map->flags_lock);
if (error) {
goto try_again;
@@ -452,11 +452,11 @@ vm_map_lock(map)
do { \
if (map->flags & VM_MAP_INTRSAFE) \
panic("vm_map_lock_read: intrsafe map"); \
- (void) lockmgr(&(map)->lock, LK_SHARED, NULL, curproc); \
+ (void) lockmgr(&(map)->lock, LK_SHARED, NULL); \
} while (0)
#else
#define vm_map_lock_read(map) \
- (void) lockmgr(&(map)->lock, LK_SHARED, NULL, curproc)
+ (void) lockmgr(&(map)->lock, LK_SHARED, NULL)
#endif
#define vm_map_unlock(map) \
@@ -464,24 +464,24 @@ do { \
if ((map)->flags & VM_MAP_INTRSAFE) \
simple_unlock(&(map)->lock.lk_interlock); \
else \
- (void) lockmgr(&(map)->lock, LK_RELEASE, NULL, curproc);\
+ (void) lockmgr(&(map)->lock, LK_RELEASE, NULL); \
} while (0)
#define vm_map_unlock_read(map) \
- (void) lockmgr(&(map)->lock, LK_RELEASE, NULL, curproc)
+ (void) lockmgr(&(map)->lock, LK_RELEASE, NULL)
#define vm_map_downgrade(map) \
- (void) lockmgr(&(map)->lock, LK_DOWNGRADE, NULL, curproc)
+ (void) lockmgr(&(map)->lock, LK_DOWNGRADE, NULL)
#ifdef DIAGNOSTIC
#define vm_map_upgrade(map) \
do { \
- if (lockmgr(&(map)->lock, LK_UPGRADE, NULL, curproc) != 0) \
+ if (lockmgr(&(map)->lock, LK_UPGRADE, NULL) != 0) \
panic("vm_map_upgrade: failed to upgrade lock"); \
} while (0)
#else
#define vm_map_upgrade(map) \
- (void) lockmgr(&(map)->lock, LK_UPGRADE, NULL, curproc)
+ (void) lockmgr(&(map)->lock, LK_UPGRADE, NULL)
#endif
#define vm_map_busy(map) \
diff --git a/sys/uvm/uvm_swap.c b/sys/uvm/uvm_swap.c
index a0c0d55f1c6..ad60d4a692c 100644
--- a/sys/uvm/uvm_swap.c
+++ b/sys/uvm/uvm_swap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_swap.c,v 1.60 2004/12/26 21:22:14 miod Exp $ */
+/* $OpenBSD: uvm_swap.c,v 1.61 2005/11/19 02:18:02 pedro Exp $ */
/* $NetBSD: uvm_swap.c,v 1.40 2000/11/17 11:39:39 mrg Exp $ */
/*
@@ -638,7 +638,7 @@ sys_swapctl(p, v, retval)
/*
* ensure serialized syscall access by grabbing the swap_syscall_lock
*/
- lockmgr(&swap_syscall_lock, LK_EXCLUSIVE, NULL, p);
+ lockmgr(&swap_syscall_lock, LK_EXCLUSIVE, NULL);
/*
* we handle the non-priv NSWAP and STATS request first.
@@ -877,7 +877,7 @@ sys_swapctl(p, v, retval)
vput(vp);
out:
- lockmgr(&swap_syscall_lock, LK_RELEASE, NULL, p);
+ lockmgr(&swap_syscall_lock, LK_RELEASE, NULL);
UVMHIST_LOG(pdhist, "<- done! error=%d", error, 0, 0, 0);
return (error);
diff --git a/sys/uvm/uvm_vnode.c b/sys/uvm/uvm_vnode.c
index 83f7c85f544..58715206ed8 100644
--- a/sys/uvm/uvm_vnode.c
+++ b/sys/uvm/uvm_vnode.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_vnode.c,v 1.39 2004/12/26 21:22:14 miod Exp $ */
+/* $OpenBSD: uvm_vnode.c,v 1.40 2005/11/19 02:18:02 pedro Exp $ */
/* $NetBSD: uvm_vnode.c,v 1.36 2000/11/24 20:34:01 chs Exp $ */
/*
@@ -1930,7 +1930,7 @@ uvm_vnp_sync(mp)
* step 1: ensure we are only ones using the uvn_sync_q by locking
* our lock...
*/
- lockmgr(&uvn_sync_lock, LK_EXCLUSIVE, NULL, curproc);
+ lockmgr(&uvn_sync_lock, LK_EXCLUSIVE, NULL);
/*
* step 2: build up a simpleq of uvns of interest based on the
@@ -2025,5 +2025,5 @@ uvm_vnp_sync(mp)
/*
* done! release sync lock
*/
- lockmgr(&uvn_sync_lock, LK_RELEASE, (void *)0, curproc);
+ lockmgr(&uvn_sync_lock, LK_RELEASE, NULL);
}