fork: use vma_pages() to simplify the code
Subsystems (3)
PATCH 1/1 fork: use vma_pages() to simplify the code
The current code can be replaced by vma_pages().
So use it to simplify the code.
Signed-off-by Huang Shijie <[email protected]>
--- kernel/fork.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/fork.c +1 -1
@@ -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;
Signature · 1 line
1.7.4.4