Skip to content

Commit

Permalink
mm/mmap.c: remove redundant local variables for may_expand_vm()
Browse files Browse the repository at this point in the history
Simplify may_expand_vm().

[akpm@linux-foundation.org: further simplification, per Naoya Horiguchi]
Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Chen Gang authored and Linus Torvalds committed Jan 15, 2016
1 parent ab7a5af commit 0b57d6b
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions mm/mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
unsigned long cur = mm->total_vm; /* pages */
unsigned long lim;

lim = rlimit(RLIMIT_AS) >> PAGE_SHIFT;

if (cur + npages > lim)
return 0;
return 1;
return mm->total_vm + npages <= rlimit(RLIMIT_AS) >> PAGE_SHIFT;
}

static int special_mapping_fault(struct vm_area_struct *vma,
Expand Down

0 comments on commit 0b57d6b

Please sign in to comment.