]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mm: Convert vma_lookup() to use the Maple Tree
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Fri, 29 Oct 2021 01:53:09 +0000 (21:53 -0400)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Sat, 30 Oct 2021 03:37:29 +0000 (23:37 -0400)
Unlike the rbtree, the Maple Tree will return a NULL if there's
nothing at a particular address.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
include/linux/mm.h

index ec549a985e6967d003baba7a18095fa127fa6f7c..6717446d2f81d6cb0ec112dad4fefe3a9c580291 100644 (file)
@@ -2739,12 +2739,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)