diff --git a/include/linux/mm.h b/include/linux/mm.h index a9a1b9f9f97c..62ce759bdcff 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -3094,6 +3094,7 @@ unsigned long change_prot_numa(struct vm_area_struct *vma, unsigned long start, unsigned long end); #endif +struct vm_area_struct *find_extend_vma(struct mm_struct *, unsigned long addr); struct vm_area_struct *find_extend_vma_locked(struct mm_struct *, unsigned long addr); int remap_pfn_range(struct vm_area_struct *, unsigned long addr, diff --git a/mm/mmap.c b/mm/mmap.c index 75703bcea8a7..a6857acce59f 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -2231,6 +2231,20 @@ struct vm_area_struct *find_extend_vma_locked(struct mm_struct *mm, unsigned lon } #endif +/* + * ANDROID: Reintroduce find_extend_vma() as it's still used by some external + * modules. It was removed in commit 8d7071af8907 ("mm: always expand the + * stack with the mmap write lock held") + * In the future, everyone should just move to use the correct function instead + * of this old, legacy one. + */ +struct vm_area_struct *find_extend_vma(struct mm_struct *mm, + unsigned long addr) +{ + return find_extend_vma_locked(mm, addr); +} +EXPORT_SYMBOL_GPL(find_extend_vma); + /* * IA64 has some horrid mapping rules: it can expand both up and down, * but with various special rules.