From: Liam R. Howlett Date: Mon, 1 Mar 2021 19:01:06 +0000 (-0500) Subject: mm: Add vma_lookup() X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=b38999dc36ebecaa4ce2706693da6fdcfa5ac866;p=users%2Fjedix%2Flinux-maple.git 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 --- 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;