Commit 0b57d6ba authored by Chen Gang's avatar Chen Gang Committed by Linus Torvalds

mm/mmap.c: remove redundant local variables for may_expand_vm()

Simplify may_expand_vm().

[akpm@linux-foundation.org: further simplification, per Naoya Horiguchi]
Signed-off-by: default avatarChen Gang <gang.chen.5i5j@gmail.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent ab7a5af7
...@@ -2988,14 +2988,7 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap, ...@@ -2988,14 +2988,7 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap,
*/ */
int may_expand_vm(struct mm_struct *mm, unsigned long npages) int may_expand_vm(struct mm_struct *mm, unsigned long npages)
{ {
unsigned long cur = mm->total_vm; /* pages */ return mm->total_vm + npages <= rlimit(RLIMIT_AS) >> PAGE_SHIFT;
unsigned long lim;
lim = rlimit(RLIMIT_AS) >> PAGE_SHIFT;
if (cur + npages > lim)
return 0;
return 1;
} }
static int special_mapping_fault(struct vm_area_struct *vma, static int special_mapping_fault(struct vm_area_struct *vma,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment