From c4e357e8d313815a72b435dade6624b25e85386d Mon Sep 17 00:00:00 2001 From: Andrey Zonov Date: Wed, 5 Sep 2012 18:19:54 +0000 Subject: [PATCH] - 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 --- sys/vm/vm_mmap.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c index 7c9406f2fcde..e0aab734e26b 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