]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mm: Convert vma_lookup() to use mtree_load()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Fri, 29 Oct 2021 01:53:09 +0000 (21:53 -0400)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Mon, 14 Mar 2022 18:49:45 +0000 (14: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.

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>
include/linux/mm.h

index 1d37cc4ff87107c9e0b011278433b4e33d72e124..d2090336d2de345274edc35674ba7ab8b53c4a68 100644 (file)
@@ -2801,12 +2801,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)