[cleanup][PATCH 2/2] mlock_vma_pages_range() only return success or failure

From: KOSAKI Motohiro
Date: Sun Dec 27 2009 - 21:46:48 EST


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 <kosaki.motohiro@xxxxxxxxxxxxxx>
---
mm/mmap.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/mmap.c b/mm/mmap.c
index 826b0ec..0f10176 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -1247,8 +1247,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;
--
1.6.5.2



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/