aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>2010-03-05 16:41:43 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-06 14:26:24 -0500
commit06f9d8c2b50060543fb6e0af87ddb86e654dee6b (patch)
tree0e0f7687c58e0948334f238208529d65de165eea
parentc58267c32429ea6535428ca6b8a036892c1697f2 (diff)
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 <kosaki.motohiro@jp.fujitsu.com> Cc: Nick Piggin <npiggin@suse.de> Cc: Lee Schermerhorn <lee.schermerhorn@hp.com> Cc: Rik van Riel <riel@redhat.com> Cc: KAMEZAWA Hiroyuki <kamewzawa.hiroyu@jp.fujitsu.com> Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--mm/mmap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/mmap.c b/mm/mmap.c
index 7acd7b0ad176..c646618702cf 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -1265,8 +1265,8 @@ out:
1265 mm->total_vm += len >> PAGE_SHIFT; 1265 mm->total_vm += len >> PAGE_SHIFT;
1266 vm_stat_account(mm, vm_flags, file, len >> PAGE_SHIFT); 1266 vm_stat_account(mm, vm_flags, file, len >> PAGE_SHIFT);
1267 if (vm_flags & VM_LOCKED) { 1267 if (vm_flags & VM_LOCKED) {
1268 long nr_pages = mlock_vma_pages_range(vma, addr, addr + len); 1268 if (!mlock_vma_pages_range(vma, addr, addr + len))
1269 mm->locked_vm += (len >> PAGE_SHIFT) - nr_pages; 1269 mm->locked_vm += (len >> PAGE_SHIFT);
1270 } else if ((flags & MAP_POPULATE) && !(flags & MAP_NONBLOCK)) 1270 } else if ((flags & MAP_POPULATE) && !(flags & MAP_NONBLOCK))
1271 make_pages_present(addr, addr + len); 1271 make_pages_present(addr, addr + len);
1272 return addr; 1272 return addr;