Commit dd05f5ec authored by Chen Haonan's avatar Chen Haonan Committed by Andrew Morton

mm: use vma_pages() for vma objects

vma_pages() is more readable and also better at avoiding error codes, so
use vma_pages() instead of direct operations on vma

Link: https://lkml.kernel.org/r/tencent_151850CF327EB055BBC83298A929BD06CD0A@qq.comSigned-off-by: default avatarChen Haonan <chen.haonan2@zte.com.cn>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 4196810a
...@@ -616,7 +616,7 @@ folio_within_range(struct folio *folio, struct vm_area_struct *vma, ...@@ -616,7 +616,7 @@ folio_within_range(struct folio *folio, struct vm_area_struct *vma,
unsigned long start, unsigned long end) unsigned long start, unsigned long end)
{ {
pgoff_t pgoff, addr; pgoff_t pgoff, addr;
unsigned long vma_pglen = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; unsigned long vma_pglen = vma_pages(vma);
VM_WARN_ON_FOLIO(folio_test_ksm(folio), folio); VM_WARN_ON_FOLIO(folio_test_ksm(folio), folio);
if (start > end) if (start > end)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment