summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_mmap.c
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2002-05-18 07:48:06 +0000
committeralc <alc@FreeBSD.org>2002-05-18 07:48:06 +0000
commitb4282fb943cfd5a08b7f9baef013c294db04cee2 (patch)
treebeb8c14f2bcf2a2256cebc57c7a4acb680403ca3 /sys/vm/vm_mmap.c
parent10889ae6562cdd1e12fe30c413fca495aa709e22 (diff)
downloadFreeBSD-src-b4282fb943cfd5a08b7f9baef013c294db04cee2.zip
FreeBSD-src-b4282fb943cfd5a08b7f9baef013c294db04cee2.tar.gz
o Remove GIANT_REQUIRED from vm_map_madvise(). Instead, acquire and
release Giant around vm_map_madvise()'s call to pmap_object_init_pt(). o Replace GIANT_REQUIRED in vm_object_madvise() with the acquisition and release of Giant. o Remove the acquisition and release of Giant from madvise().
Diffstat (limited to 'sys/vm/vm_mmap.c')
-rw-r--r--sys/vm/vm_mmap.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c
index d2d2851..fca62e7 100644
--- a/sys/vm/vm_mmap.c
+++ b/sys/vm/vm_mmap.c
@@ -743,7 +743,6 @@ madvise(td, uap)
struct madvise_args *uap;
{
vm_offset_t start, end;
- int ret;
/*
* Check for illegal behavior
@@ -771,10 +770,10 @@ madvise(td, uap)
start = trunc_page((vm_offset_t) uap->addr);
end = round_page((vm_offset_t) uap->addr + uap->len);
- mtx_lock(&Giant);
- ret = vm_map_madvise(&td->td_proc->p_vmspace->vm_map, start, end, uap->behav);
- mtx_unlock(&Giant);
- return (ret ? EINVAL : 0);
+ if (vm_map_madvise(&td->td_proc->p_vmspace->vm_map, start, end,
+ uap->behav))
+ return (EINVAL);
+ return (0);
}
#ifndef _SYS_SYSPROTO_H_
OpenPOWER on IntegriCloud