From: Liam R. Howlett Date: Mon, 4 Jan 2021 20:03:49 +0000 (-0500) Subject: mm/mremap: Use vma_next() instead of vma linked list X-Git-Tag: howlett/maple_spf/20210128~9 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=a3a49158b6d3ddd408a51403d1c4893cfeee8129;p=users%2Fjedix%2Flinux-maple.git mm/mremap: Use vma_next() instead of vma linked list Signed-off-by: Liam R. Howlett --- diff --git a/mm/mremap.c b/mm/mremap.c index 6e3a4bcea83b..540c74eb0c23 100644 --- a/mm/mremap.c +++ b/mm/mremap.c @@ -614,7 +614,7 @@ static unsigned long move_vma(struct vm_area_struct *vma, if (excess) { vma->vm_flags |= VM_ACCOUNT; if (split) - vma->vm_next->vm_flags |= VM_ACCOUNT; + vma_next(mm, vma)->vm_flags |= VM_ACCOUNT; } return new_addr; @@ -787,9 +787,11 @@ out: static int vma_expandable(struct vm_area_struct *vma, unsigned long delta) { unsigned long end = vma->vm_end + delta; + struct vm_area_struct *next; if (end < vma->vm_end) /* overflow */ return 0; - if (vma->vm_next && vma->vm_next->vm_start < end) /* intersection */ + next = vma_next(vma->vm_mm, vma); + if (next && next->vm_start < end) /* intersection */ return 0; if (get_unmapped_area(NULL, vma->vm_start, end - vma->vm_start, 0, MAP_FIXED) & ~PAGE_MASK)