From: Liam R. Howlett Date: Mon, 4 Jan 2021 20:10:54 +0000 (-0500) Subject: mm/util: Remove __vma_link_list() and __vma_unlink_list() X-Git-Tag: howlett/maple_spf/20210128~2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=ac050de670de227df17afb6f814400c2e5cae3e5;p=users%2Fjedix%2Flinux-maple.git mm/util: Remove __vma_link_list() and __vma_unlink_list() Signed-off-by: Liam R. Howlett --- diff --git a/mm/mmap.c b/mm/mmap.c index e8631809c5fb..b5dd101be9f4 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -602,7 +602,6 @@ static void vma_mas_link(struct mm_struct *mm, struct vm_area_struct *vma, } vma_mas_store(vma, mas); - __vma_link_list(mm, vma, prev); __vma_link_file(vma); if (mapping) @@ -623,7 +622,6 @@ static void vma_link(struct mm_struct *mm, struct vm_area_struct *vma, } vma_mt_store(mm, vma); - __vma_link_list(mm, vma, prev); __vma_link_file(vma); if (mapping) @@ -643,7 +641,6 @@ static void __insert_vm_struct(struct mm_struct *mm, struct vm_area_struct *vma) BUG_ON(range_has_overlap(mm, vma->vm_start, vma->vm_end, &prev)); vma_mt_store(mm, vma); - __vma_link_list(mm, vma, prev); mm->map_count++; } @@ -700,13 +697,8 @@ inline int vma_expand(struct ma_state *mas, struct vm_area_struct *vma, } /* Expanding over the next vma */ - if (remove_next) { - /* Remove from mm linked list - also updates highest_vm_end */ - __vma_unlink_list(mm, next); - - if (file) - __remove_shared_vm_struct(next, file, mapping); - + if (remove_next && file) { + __remove_shared_vm_struct(next, file, mapping); } else if (!next) { mm->highest_vm_end = vm_end_gap(vma); } @@ -915,10 +907,8 @@ again: flush_dcache_mmap_unlock(mapping); } - if (remove_next) { - __vma_unlink_list(mm, next); - if (file) - __remove_shared_vm_struct(next, file, mapping); + if (remove_next && file) { + __remove_shared_vm_struct(next, file, mapping); } else if (insert) { /* * split_vma has split insert from vma, and needs @@ -3179,7 +3169,6 @@ static int do_brk_flags(struct ma_state *mas, struct vm_area_struct **brkvma, if (!prev) prev = mas_prev(mas, 0); - __vma_link_list(mm, vma, prev); mm->map_count++; *brkvma = vma; out: diff --git a/mm/util.c b/mm/util.c index f57a76b53b23..b30ceeec55f0 100644 --- a/mm/util.c +++ b/mm/util.c @@ -271,46 +271,6 @@ void *memdup_user_nul(const void __user *src, size_t len) } EXPORT_SYMBOL(memdup_user_nul); -void __vma_link_list(struct mm_struct *mm, struct vm_area_struct *vma, - struct vm_area_struct *prev) -{ - struct vm_area_struct *next; - - vma->vm_prev = prev; - if (prev) { - next = prev->vm_next; - prev->vm_next = vma; - } else { - next = mm->mmap; - mm->mmap = vma; - } - vma->vm_next = next; - if (next) - next->vm_prev = vma; - else - mm->highest_vm_end = vm_end_gap(vma); -} - -void __vma_unlink_list(struct mm_struct *mm, struct vm_area_struct *vma) -{ - struct vm_area_struct *prev, *next; - - next = vma->vm_next; - prev = vma->vm_prev; - if (prev) - prev->vm_next = next; - else - mm->mmap = next; - if (next) - next->vm_prev = prev; - else { - if (prev) - mm->highest_vm_end = vm_end_gap(prev); - else - mm->highest_vm_end = 0; - } -} - /* Check if the vma is being used as a stack by this task */ int vma_is_stack_for_current(struct vm_area_struct *vma) {