Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

[PATCH] freepgt: mpnt to vma cleanup

While dabbling here in mmap.c, clean up mysterious "mpnt"s to "vma"s.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Hugh Dickins and committed by
Linus Torvalds
146425a3 8f6c99c1

+17 -18
+17 -18
mm/mmap.c
··· 1602 1602 * Ok - we have the memory areas we should free on the 'free' list, 1603 1603 * so release them, and do the vma updates. 1604 1604 */ 1605 - static void unmap_vma_list(struct mm_struct *mm, 1606 - struct vm_area_struct *mpnt) 1605 + static void unmap_vma_list(struct mm_struct *mm, struct vm_area_struct *vma) 1607 1606 { 1608 1607 do { 1609 - struct vm_area_struct *next = mpnt->vm_next; 1610 - unmap_vma(mm, mpnt); 1611 - mpnt = next; 1612 - } while (mpnt != NULL); 1608 + struct vm_area_struct *next = vma->vm_next; 1609 + unmap_vma(mm, vma); 1610 + vma = next; 1611 + } while (vma); 1613 1612 validate_mm(mm); 1614 1613 } 1615 1614 ··· 1719 1720 int do_munmap(struct mm_struct *mm, unsigned long start, size_t len) 1720 1721 { 1721 1722 unsigned long end; 1722 - struct vm_area_struct *mpnt, *prev, *last; 1723 + struct vm_area_struct *vma, *prev, *last; 1723 1724 1724 1725 if ((start & ~PAGE_MASK) || start > TASK_SIZE || len > TASK_SIZE-start) 1725 1726 return -EINVAL; ··· 1728 1729 return -EINVAL; 1729 1730 1730 1731 /* Find the first overlapping VMA */ 1731 - mpnt = find_vma_prev(mm, start, &prev); 1732 - if (!mpnt) 1732 + vma = find_vma_prev(mm, start, &prev); 1733 + if (!vma) 1733 1734 return 0; 1734 - /* we have start < mpnt->vm_end */ 1735 + /* we have start < vma->vm_end */ 1735 1736 1736 1737 /* if it doesn't overlap, we have nothing.. */ 1737 1738 end = start + len; 1738 - if (mpnt->vm_start >= end) 1739 + if (vma->vm_start >= end) 1739 1740 return 0; 1740 1741 1741 1742 /* ··· 1745 1746 * unmapped vm_area_struct will remain in use: so lower split_vma 1746 1747 * places tmp vma above, and higher split_vma places tmp vma below. 1747 1748 */ 1748 - if (start > mpnt->vm_start) { 1749 - int error = split_vma(mm, mpnt, start, 0); 1749 + if (start > vma->vm_start) { 1750 + int error = split_vma(mm, vma, start, 0); 1750 1751 if (error) 1751 1752 return error; 1752 - prev = mpnt; 1753 + prev = vma; 1753 1754 } 1754 1755 1755 1756 /* Does it split the last one? */ ··· 1759 1760 if (error) 1760 1761 return error; 1761 1762 } 1762 - mpnt = prev? prev->vm_next: mm->mmap; 1763 + vma = prev? prev->vm_next: mm->mmap; 1763 1764 1764 1765 /* 1765 1766 * Remove the vma's, and unmap the actual pages 1766 1767 */ 1767 - detach_vmas_to_be_unmapped(mm, mpnt, prev, end); 1768 - unmap_region(mm, mpnt, prev, start, end); 1768 + detach_vmas_to_be_unmapped(mm, vma, prev, end); 1769 + unmap_region(mm, vma, prev, start, end); 1769 1770 1770 1771 /* Fix up all other VM information */ 1771 - unmap_vma_list(mm, mpnt); 1772 + unmap_vma_list(mm, vma); 1772 1773 1773 1774 return 0; 1774 1775 }