aboutsummaryrefslogtreecommitdiffstats
path: root/mm/mmap.c
diff options
context:
space:
mode:
authorHugh Dickins <hugh@veritas.com>2005-10-29 21:15:56 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-10-30 00:40:37 -0400
commitab50b8ed818016cfecd747d6d4bb9139986bc029 (patch)
tree33c666578c14dccce05b3f7a5538405098eebcc4 /mm/mmap.c
parent72866f6f277ec0ddd6df7a3b6ecdcf59a28de115 (diff)
[PATCH] mm: vm_stat_account unshackled
The original vm_stat_account has fallen into disuse, with only one user, and only one user of vm_stat_unaccount. It's easier to keep track if we convert them all to __vm_stat_account, then free it from its __shackles. Signed-off-by: Hugh Dickins <hugh@veritas.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm/mmap.c')
-rw-r--r--mm/mmap.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/mm/mmap.c b/mm/mmap.c
index fa11d91242e8..e1780266ac7d 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -832,7 +832,7 @@ none:
832} 832}
833 833
834#ifdef CONFIG_PROC_FS 834#ifdef CONFIG_PROC_FS
835void __vm_stat_account(struct mm_struct *mm, unsigned long flags, 835void vm_stat_account(struct mm_struct *mm, unsigned long flags,
836 struct file *file, long pages) 836 struct file *file, long pages)
837{ 837{
838 const unsigned long stack_flags 838 const unsigned long stack_flags
@@ -1110,7 +1110,7 @@ munmap_back:
1110 } 1110 }
1111out: 1111out:
1112 mm->total_vm += len >> PAGE_SHIFT; 1112 mm->total_vm += len >> PAGE_SHIFT;
1113 __vm_stat_account(mm, vm_flags, file, len >> PAGE_SHIFT); 1113 vm_stat_account(mm, vm_flags, file, len >> PAGE_SHIFT);
1114 if (vm_flags & VM_LOCKED) { 1114 if (vm_flags & VM_LOCKED) {
1115 mm->locked_vm += len >> PAGE_SHIFT; 1115 mm->locked_vm += len >> PAGE_SHIFT;
1116 make_pages_present(addr, addr + len); 1116 make_pages_present(addr, addr + len);
@@ -1475,7 +1475,7 @@ static int acct_stack_growth(struct vm_area_struct * vma, unsigned long size, un
1475 mm->total_vm += grow; 1475 mm->total_vm += grow;
1476 if (vma->vm_flags & VM_LOCKED) 1476 if (vma->vm_flags & VM_LOCKED)
1477 mm->locked_vm += grow; 1477 mm->locked_vm += grow;
1478 __vm_stat_account(mm, vma->vm_flags, vma->vm_file, grow); 1478 vm_stat_account(mm, vma->vm_flags, vma->vm_file, grow);
1479 return 0; 1479 return 0;
1480} 1480}
1481 1481
@@ -1610,15 +1610,15 @@ find_extend_vma(struct mm_struct * mm, unsigned long addr)
1610 * By the time this function is called, the area struct has been 1610 * By the time this function is called, the area struct has been
1611 * removed from the process mapping list. 1611 * removed from the process mapping list.
1612 */ 1612 */
1613static void unmap_vma(struct mm_struct *mm, struct vm_area_struct *area) 1613static void unmap_vma(struct mm_struct *mm, struct vm_area_struct *vma)
1614{ 1614{
1615 size_t len = area->vm_end - area->vm_start; 1615 long nrpages = vma_pages(vma);
1616 1616
1617 area->vm_mm->total_vm -= len >> PAGE_SHIFT; 1617 mm->total_vm -= nrpages;
1618 if (area->vm_flags & VM_LOCKED) 1618 if (vma->vm_flags & VM_LOCKED)
1619 area->vm_mm->locked_vm -= len >> PAGE_SHIFT; 1619 mm->locked_vm -= nrpages;
1620 vm_stat_unaccount(area); 1620 vm_stat_account(mm, vma->vm_flags, vma->vm_file, -nrpages);
1621 remove_vm_struct(area); 1621 remove_vm_struct(vma);
1622} 1622}
1623 1623
1624/* 1624/*