* [PATCH] fork: use vma_pages() to simplify the code
@ 2012-05-30 18:50 Huang Shijie
0 siblings, 0 replies; only message in thread
From: Huang Shijie @ 2012-05-30 18:50 UTC (permalink / raw)
To: akpm; +Cc: linux-kernel, Huang Shijie
The current code can be replaced by vma_pages().
So use it to simplify the code.
Signed-off-by: Huang Shijie <shijie8@gmail.com>
---
kernel/fork.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/kernel/fork.c b/kernel/fork.c
index 3417e1b..3decf6d 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -386,7 +386,7 @@ 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;
+ len = vma_pages(mpnt);
if (security_vm_enough_memory_mm(oldmm, len)) /* sic */
goto fail_nomem;
charge = len;
--
1.7.4.4
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2012-05-30 6:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-30 18:50 [PATCH] fork: use vma_pages() to simplify the code Huang Shijie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®