FROMLIST: mm: separate mmap locked assertion from find_vma

This adds a new __find_vma() function, which implements find_vma minus
the mmap_assert_locked() assertion.

find_vma() is then implemented as an inline wrapper around __find_vma().

Signed-off-by: Michel Lespinasse <michel@lespinasse.org>
Link: https://lore.kernel.org/all/20220128131006.67712-13-michel@lespinasse.org/
Bug: 161210518
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: Ia999b8cb8f5eed93040ab4b3caaf90d739da908d
This commit is contained in:
Michel Lespinasse
2022-01-28 04:53:01 -08:00
committed by Todd Kjos
parent 67cc8ce9a6
commit 0823d516af
4 changed files with 14 additions and 8 deletions

View File

@@ -2693,10 +2693,17 @@ extern int expand_upwards(struct vm_area_struct *vma, unsigned long address);
#endif
/* Look up the first VMA which satisfies addr < vm_end, NULL if none. */
extern struct vm_area_struct * find_vma(struct mm_struct * mm, unsigned long addr);
extern struct vm_area_struct * __find_vma(struct mm_struct * mm, unsigned long addr);
extern struct vm_area_struct * find_vma_prev(struct mm_struct * mm, unsigned long addr,
struct vm_area_struct **pprev);
static inline
struct vm_area_struct *find_vma(struct mm_struct *mm, unsigned long addr)
{
mmap_assert_locked(mm);
return __find_vma(mm, addr);
}
/**
* find_vma_intersection() - Look up the first VMA which intersects the interval
* @mm: The process address space.