From e0be79afbf4f9cd27fb0b6e47c420fe2d2b80c44 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Sat, 18 May 2002 18:59:00 +0000 Subject: [PATCH] o Eliminate the acquisition and release of Giant from minherit(2). (vm_map_inherit() no longer requires Giant to be held.) --- sys/vm/vm_mmap.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c index fca62e754098..750ab07f7e27 100644 --- a/sys/vm/vm_mmap.c +++ b/sys/vm/vm_mmap.c @@ -698,7 +698,6 @@ minherit(td, uap) vm_offset_t addr; vm_size_t size, pageoff; vm_inherit_t inherit; - int ret; addr = (vm_offset_t)uap->addr; size = uap->len; @@ -711,12 +710,8 @@ minherit(td, uap) if (addr + size < addr) return (EINVAL); - mtx_lock(&Giant); - ret = vm_map_inherit(&td->td_proc->p_vmspace->vm_map, addr, addr+size, - inherit); - mtx_unlock(&Giant); - - switch (ret) { + switch (vm_map_inherit(&td->td_proc->p_vmspace->vm_map, addr, + addr + size, inherit)) { case KERN_SUCCESS: return (0); case KERN_PROTECTION_FAILURE: