mmap.c (497258dfafcc6b88e7c4c46a38a479721d44cf41) | mmap.c (df2a7df9a9aa32c3df227de346693e6e802c8591) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * mm/mmap.c 4 * 5 * Written by obz. 6 * 7 * Address space accounting code <alan@lxorguk.ukuu.org.uk> 8 */ --- 1726 unchanged lines hidden (view full) --- 1735 * 1736 * Return: 0 on success drops the lock of so directed, error on failure and will 1737 * still hold the lock. 1738 */ 1739int do_vma_munmap(struct vma_iterator *vmi, struct vm_area_struct *vma, 1740 unsigned long start, unsigned long end, struct list_head *uf, 1741 bool unlock) 1742{ | 1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * mm/mmap.c 4 * 5 * Written by obz. 6 * 7 * Address space accounting code <alan@lxorguk.ukuu.org.uk> 8 */ --- 1726 unchanged lines hidden (view full) --- 1735 * 1736 * Return: 0 on success drops the lock of so directed, error on failure and will 1737 * still hold the lock. 1738 */ 1739int do_vma_munmap(struct vma_iterator *vmi, struct vm_area_struct *vma, 1740 unsigned long start, unsigned long end, struct list_head *uf, 1741 bool unlock) 1742{ |
1743 struct mm_struct *mm = vma->vm_mm; 1744 1745 /* 1746 * Check if memory is sealed, prevent unmapping a sealed VMA. 1747 * can_modify_mm assumes we have acquired the lock on MM. 1748 */ 1749 if (unlikely(!can_modify_mm(mm, start, end))) 1750 return -EPERM; 1751 1752 return do_vmi_align_munmap(vmi, vma, mm, start, end, uf, unlock); | 1743 return do_vmi_align_munmap(vmi, vma, vma->vm_mm, start, end, uf, unlock); |
1753} 1754 1755/* 1756 * do_brk_flags() - Increase the brk vma if the flags match. 1757 * @vmi: The vma iterator 1758 * @addr: The start address 1759 * @len: The length of the increase 1760 * @vma: The vma, --- 621 unchanged lines hidden --- | 1744} 1745 1746/* 1747 * do_brk_flags() - Increase the brk vma if the flags match. 1748 * @vmi: The vma iterator 1749 * @addr: The start address 1750 * @len: The length of the increase 1751 * @vma: The vma, --- 621 unchanged lines hidden --- |