]> 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>
Tue, 8 Mar 2022 18:19:11 +0000 (13:19 -0500)
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 dba94d6524d57f5b469e2df991a8b320a8bba1a7..09d887c480dab38c5799712ae0b13bf75ca92deb 100644 (file)
@@ -2802,12 +2802,7 @@ extern 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)