]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mm/mmap: Change do_brk_munmap() to use do_mas_align_munmap()
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Tue, 1 Dec 2020 02:30:04 +0000 (21:30 -0500)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Fri, 11 Feb 2022 03:38:07 +0000 (22:38 -0500)
do_brk_munmap() has already aligned the address and has a maple tree
state to be used.  Use the new do_mas_align_munmap() to avoid
unnecessary alignment and error checks.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
mm/mmap.c

index a0bd61263d69a4994b6ed7754a334f99537714a9..a62a3e6bb6c3937bd4432bc2842f1f32b5f54b55 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -2982,14 +2982,15 @@ static int do_brk_munmap(struct ma_state *mas, struct vm_area_struct *vma,
        struct mm_struct *mm = vma->vm_mm;
        struct vm_area_struct unmap;
        unsigned long unmap_pages;
-       int ret = 1;
+       int ret;
 
        arch_unmap(mm, newbrk, oldbrk);
 
        if (likely((vma->vm_end < oldbrk) ||
                   ((vma->vm_start == newbrk) && (vma->vm_end == oldbrk)))) {
                /* remove entire mapping(s) */
-               ret = do_mas_munmap(mas, mm, newbrk, oldbrk-newbrk, uf, true);
+               ret = do_mas_align_munmap(mas, vma, mm, newbrk, oldbrk, uf,
+                                         true);
                goto munmap_full_vma;
        }