vma.c (224c1c702c08ca4d874690991f02e5b08c816e5b) vma.c (20831cd6f814eade5e2fffce41352d8e8de1e764)
1// SPDX-License-Identifier: GPL-2.0-or-later
2
3/*
4 * VMA-specific functions.
5 */
6
7#include "vma_internal.h"
8#include "vma.h"

--- 741 unchanged lines hidden (view full) ---

750int vms_gather_munmap_vmas(struct vma_munmap_struct *vms,
751 struct ma_state *mas_detach)
752{
753 struct vm_area_struct *next = NULL;
754 int error = -ENOMEM;
755
756 /*
757 * If we need to split any vma, do it now to save pain later.
1// SPDX-License-Identifier: GPL-2.0-or-later
2
3/*
4 * VMA-specific functions.
5 */
6
7#include "vma_internal.h"
8#include "vma.h"

--- 741 unchanged lines hidden (view full) ---

750int vms_gather_munmap_vmas(struct vma_munmap_struct *vms,
751 struct ma_state *mas_detach)
752{
753 struct vm_area_struct *next = NULL;
754 int error = -ENOMEM;
755
756 /*
757 * If we need to split any vma, do it now to save pain later.
758 *
759 * Note: mremap's move_vma VM_ACCOUNT handling assumes a partially
760 * unmapped vm_area_struct will remain in use: so lower split_vma
761 * places tmp vma above, and higher split_vma places tmp vma below.
758 * Does it split the first one?
762 */
759 */
763
764 /* Does it split the first one? */
765 if (vms->start > vms->vma->vm_start) {
766
767 /*
768 * Make sure that map_count on return from munmap() will
769 * not exceed its limit; but let map_count go just above
770 * its limit temporarily, to help free resources as expected.
771 */
772 if (vms->end < vms->vma->vm_end &&

--- 1066 unchanged lines hidden ---
760 if (vms->start > vms->vma->vm_start) {
761
762 /*
763 * Make sure that map_count on return from munmap() will
764 * not exceed its limit; but let map_count go just above
765 * its limit temporarily, to help free resources as expected.
766 */
767 if (vms->end < vms->vma->vm_end &&

--- 1066 unchanged lines hidden ---