From b1f9e8cec99dabffec8cff28bb470ff9c4a05b6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Sun, 15 Apr 2007 17:06:09 +0000 Subject: [PATCH] Instead of stating GIANT_REQUIRED, just acquire and release Giant where needed. This does not make a difference now, but will when procfs is marked MPSAFE. --- sys/fs/procfs/procfs_map.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/fs/procfs/procfs_map.c b/sys/fs/procfs/procfs_map.c index b98d207ad38..5e0b8002767 100644 --- a/sys/fs/procfs/procfs_map.c +++ b/sys/fs/procfs/procfs_map.c @@ -91,8 +91,6 @@ procfs_doprocmap(PFS_FILL_ARGS) int wrap32 = 0; #endif - GIANT_REQUIRED; - PROC_LOCK(p); error = p_candebug(td, p); PROC_UNLOCK(p); @@ -112,6 +110,9 @@ procfs_doprocmap(PFS_FILL_ARGS) wrap32 = 1; } #endif + + mtx_lock(&Giant); + error = 0; if (map != &curthread->td_proc->p_vmspace->vm_map) vm_map_lock_read(map); @@ -213,5 +214,7 @@ procfs_doprocmap(PFS_FILL_ARGS) if (map != &curthread->td_proc->p_vmspace->vm_map) vm_map_unlock_read(map); + mtx_unlock(&Giant); + return (error); }