mmap: Remove __vma_link in favour of calling vma_mt_store directly
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Thu, 17 Sep 2020 18:06:13 +0000 (14:06 -0400)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Fri, 30 Oct 2020 19:11:53 +0000 (15:11 -0400)
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
mm/mmap.c

index edbc9fded35efe59449aa98fe5fd2d57b3cd1bdd..129f4adc3af5e37631b77a907ec6b356377ed69c 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -56,7 +56,6 @@
 #include <trace/events/mmap.h>
 
 #include "internal.h"
-extern void mtree_direct_destroy(struct maple_tree *mt);
 
 #ifndef arch_mmap_check
 #define arch_mmap_check(addr, len, flags)      (0)
@@ -606,23 +605,6 @@ static inline void vma_mt_store(struct mm_struct *mm, struct vm_area_struct *vma
        mtree_store_range(&mm->mm_mt, vma->vm_start, vma->vm_end - 1, vma,
                GFP_KERNEL);
 }
-/* External interface to store a vma into an @mm.  Used in fork.
- *
- * @mm: The struct_mm
- * @vma: The vm_area_struct to store in the maple tree.
- */
-void vma_store(struct mm_struct *mm, struct vm_area_struct *vma)
-{
-       vma_mt_store(mm, vma);
-}
-
-static void
-__vma_link(struct mm_struct *mm, struct vm_area_struct *vma,
-       struct vm_area_struct *prev)
-{
-       vma_mt_store(mm, vma);
-       __vma_link_list(mm, vma, prev);
-}
 
 static void vma_link(struct mm_struct *mm, struct vm_area_struct *vma,
                        struct vm_area_struct *prev)
@@ -634,7 +616,8 @@ static void vma_link(struct mm_struct *mm, struct vm_area_struct *vma,
                i_mmap_lock_write(mapping);
        }
 
-       __vma_link(mm, vma, prev);
+       vma_mt_store(mm, vma);
+       __vma_link_list(mm, vma, prev);
        __vma_link_file(vma);
 
        if (mapping)
@@ -654,7 +637,8 @@ static void __insert_vm_struct(struct mm_struct *mm, struct vm_area_struct *vma)
 
        if (range_has_overlap(mm, vma->vm_start, vma->vm_end, &prev))
                BUG();
-       __vma_link(mm, vma, prev);
+       vma_mt_store(mm, vma);
+       __vma_link_list(mm, vma, prev);
        mm->map_count++;
 }