projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bc452b4
)
fork: use vma_pages() to simplify the code
author
Huang Shijie
<
[email protected]
>
Mon, 30 Jul 2012 21:42:30 +0000
(14:42 -0700)
committer
Linus Torvalds
<
[email protected]
>
Tue, 31 Jul 2012 00:25:20 +0000
(17:25 -0700)
The current code can be replaced by vma_pages(). So use it to simplify
the code.
[
[email protected]
: initialise `len' at its definition site]
Signed-off-by: Huang Shijie <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
kernel/fork.c
patch
|
blob
|
history
diff --git
a/kernel/fork.c
b/kernel/fork.c
index ff1cad3b7bdc5eda7d525c165c6aaa4cfe659aec..2c1802948a38034598459e8d9b8cfeb533095679 100644
(file)
--- a/
kernel/fork.c
+++ b/
kernel/fork.c
@@
-391,8
+391,8
@@
static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
}
charge = 0;
if (mpnt->vm_flags & VM_ACCOUNT) {
- unsigned long len;
- len = (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT;
+ unsigned long len
= vma_pages(mpnt)
;
+
if (security_vm_enough_memory_mm(oldmm, len)) /* sic */
goto fail_nomem;
charge = len;