summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authorzont <zont@FreeBSD.org>2012-09-05 18:19:54 +0000
committerzont <zont@FreeBSD.org>2012-09-05 18:19:54 +0000
commit2b9b209471edea1d724cc6e6d55489bf13571b19 (patch)
tree9613ab908c5972c3592b25c7daf09f0529dc4f5c /sys/vm
parent426f8135ea4d2f411057f06a08d5754090f70957 (diff)
downloadFreeBSD-src-2b9b209471edea1d724cc6e6d55489bf13571b19.zip
FreeBSD-src-2b9b209471edea1d724cc6e6d55489bf13571b19.tar.gz
- Simplify VM code by using vmspace_wired_count() for counting wired
memory of a process. Reviewed by: avg Approved by: kib (mentor) MFC after: 2 weeks
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_mmap.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c
index 7c9406f..e0aab73 100644
--- a/sys/vm/vm_mmap.c
+++ b/sys/vm/vm_mmap.c
@@ -1050,8 +1050,7 @@ sys_mlock(td, uap)
return (ENOMEM);
proc = td->td_proc;
PROC_LOCK(proc);
- nsize = ptoa(npages +
- pmap_wired_count(vm_map_pmap(&proc->p_vmspace->vm_map)));
+ nsize = ptoa(npages + vmspace_wired_count(proc->p_vmspace));
if (nsize > lim_cur(proc, RLIMIT_MEMLOCK)) {
PROC_UNLOCK(proc);
return (ENOMEM);
@@ -1072,7 +1071,7 @@ sys_mlock(td, uap)
if (error != KERN_SUCCESS) {
PROC_LOCK(proc);
racct_set(proc, RACCT_MEMLOCK,
- ptoa(pmap_wired_count(vm_map_pmap(&proc->p_vmspace->vm_map))));
+ ptoa(vmspace_wired_count(proc->p_vmspace)));
PROC_UNLOCK(proc);
}
#endif
@@ -1148,7 +1147,7 @@ sys_mlockall(td, uap)
if (error != KERN_SUCCESS) {
PROC_LOCK(td->td_proc);
racct_set(td->td_proc, RACCT_MEMLOCK,
- ptoa(pmap_wired_count(vm_map_pmap(&td->td_proc->p_vmspace->vm_map))));
+ ptoa(vmspace_wired_count(td->td_proc->p_vmspace)));
PROC_UNLOCK(td->td_proc);
}
#endif
OpenPOWER on IntegriCloud