From b38999dc36ebecaa4ce2706693da6fdcfa5ac866 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett" Date: Mon, 1 Mar 2021 14:01:06 -0500 Subject: [PATCH] mm: Add vma_lookup() Walk the maple tree to find the requested address. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Liam R. Howlett --- include/linux/mm.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index 5afa228f04a9..d06743e1e05c 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2669,6 +2669,13 @@ static inline struct vm_area_struct *vma_prev(struct mm_struct *mm, return mas_prev(&mas, 0); } +static inline +struct vm_area_struct *vma_lookup(struct mm_struct *mm, unsigned long addr) +{ + return mtree_load(&mm->mm_mt, addr); +} + + static inline unsigned long vm_start_gap(struct vm_area_struct *vma) { unsigned long vm_start = vma->vm_start; -- 2.50.1