From 3861cad7cb7161c261a7b1f67725fffd1ccfc61f Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett" Date: Thu, 17 Sep 2020 14:06:13 -0400 Subject: [PATCH] mmap: Remove __vma_link in favour of calling vma_mt_store directly Signed-off-by: Liam R. Howlett --- mm/mmap.c | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index 5d6a1e3f1cc7..569f44abf829 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -56,7 +56,6 @@ #include #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++; } -- 2.50.1