]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mm: convert vma_lookup() to use mtree_load()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Thu, 14 Apr 2022 06:07:16 +0000 (23:07 -0700)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Thu, 14 Apr 2022 21:49:46 +0000 (17:49 -0400)
Unlike the rbtree, the Maple Tree will return a NULL if there's nothing at
a particular address.

Since the previous commit dropped the vmacache, it is now possible to
consult the tree directly.

Link: https://lkml.kernel.org/r/20220404143501.2016403-29-Liam.Howlett@oracle.com
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/mm.h

index 9d0d76c410e74cdbf25df0f10882b5ceaa5a7886..6bb43774a707ba7885c76853ca3c66336c5c5d58 100644 (file)
@@ -2802,12 +2802,7 @@ struct vm_area_struct *find_vma_intersection(struct mm_struct *mm,
 static inline
 struct vm_area_struct *vma_lookup(struct mm_struct *mm, unsigned long addr)
 {
-       struct vm_area_struct *vma = find_vma(mm, addr);
-
-       if (vma && addr < vma->vm_start)
-               vma = NULL;
-
-       return vma;
+       return mtree_load(&mm->mm_mt, addr);
 }
 
 static inline unsigned long vm_start_gap(struct vm_area_struct *vma)