mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
mm: mlock_vma_pages_range() only return success or failure
Currently, mlock_vma_pages_range() only return len or 0. then current error handling of mmap_region() is meaningless complex. This patch makes simplify and makes consist with brk() code. Signed-off-by: KOSAKI Motohiro <[email protected]> Cc: Nick Piggin <[email protected]> Cc: Lee Schermerhorn <[email protected]> Cc: Rik van Riel <[email protected]> Cc: KAMEZAWA Hiroyuki <[email protected]> Cc: Hugh Dickins <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
c58267c324
commit
06f9d8c2b5
1 changed files with 2 additions and 2 deletions
|
|
@ -1265,8 +1265,8 @@ out:
|
|||
mm->total_vm += len >> PAGE_SHIFT;
|
||||
vm_stat_account(mm, vm_flags, file, len >> PAGE_SHIFT);
|
||||
if (vm_flags & VM_LOCKED) {
|
||||
long nr_pages = mlock_vma_pages_range(vma, addr, addr + len);
|
||||
mm->locked_vm += (len >> PAGE_SHIFT) - nr_pages;
|
||||
if (!mlock_vma_pages_range(vma, addr, addr + len))
|
||||
mm->locked_vm += (len >> PAGE_SHIFT);
|
||||
} else if ((flags & MAP_POPULATE) && !(flags & MAP_NONBLOCK))
|
||||
make_pages_present(addr, addr + len);
|
||||
return addr;
|
||||
|
|
|
|||
Loading…
Reference in a new issue