mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
pagewalk: add walk_page_vma()
Introduce walk_page_vma(), which is useful for the callers which want to walk over a given vma. It's used by later patches. Signed-off-by: Naoya Horiguchi <[email protected]> Acked-by: Kirill A. Shutemov <[email protected]> Cc: "Kirill A. Shutemov" <[email protected]> Cc: Andrea Arcangeli <[email protected]> Cc: Cyrill Gorcunov <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Pavel Emelyanov <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
fafaa4264e
commit
900fc5f197
2 changed files with 19 additions and 0 deletions
|
|
@ -272,3 +272,21 @@ int walk_page_range(unsigned long start, unsigned long end,
|
|||
} while (start = next, start < end);
|
||||
return err;
|
||||
}
|
||||
|
||||
int walk_page_vma(struct vm_area_struct *vma, struct mm_walk *walk)
|
||||
{
|
||||
int err;
|
||||
|
||||
if (!walk->mm)
|
||||
return -EINVAL;
|
||||
|
||||
VM_BUG_ON(!rwsem_is_locked(&walk->mm->mmap_sem));
|
||||
VM_BUG_ON(!vma);
|
||||
walk->vma = vma;
|
||||
err = walk_page_test(vma->vm_start, vma->vm_end, walk);
|
||||
if (err > 0)
|
||||
return 0;
|
||||
if (err < 0)
|
||||
return err;
|
||||
return __walk_page_range(vma->vm_start, vma->vm_end, walk);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue