diff options
author | Hugh Dickins <hugh@veritas.com> | 2005-10-29 21:15:55 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-10-30 00:40:36 -0400 |
commit | 72866f6f277ec0ddd6df7a3b6ecdcf59a28de115 (patch) | |
tree | a76bb7fb8e092250c4399c20f0c7c973b77cb0bb /mm/memory.c | |
parent | 6237bcd94851e9cf0ecd2520d744779df0f5a9a6 (diff) |
[PATCH] mm: anon is already wrprotected
do_anonymous_page's pte_wrprotect causes some confusion: in such a case,
vm_page_prot must already be forcing COW, so must omit write permission, and
so the pte_wrprotect is redundant. Replace it by a comment to that effect,
and reword the comment on unuse_pte which also caused confusion.
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm/memory.c')
-rw-r--r-- | mm/memory.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/mm/memory.c b/mm/memory.c index fd5d4c6dc762..13667681cd16 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -1768,13 +1768,14 @@ do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma, | |||
1768 | unsigned long addr) | 1768 | unsigned long addr) |
1769 | { | 1769 | { |
1770 | pte_t entry; | 1770 | pte_t entry; |
1771 | struct page * page = ZERO_PAGE(addr); | ||
1772 | 1771 | ||
1773 | /* Read-only mapping of ZERO_PAGE. */ | 1772 | /* Mapping of ZERO_PAGE - vm_page_prot is readonly */ |
1774 | entry = pte_wrprotect(mk_pte(ZERO_PAGE(addr), vma->vm_page_prot)); | 1773 | entry = mk_pte(ZERO_PAGE(addr), vma->vm_page_prot); |
1775 | 1774 | ||
1776 | /* ..except if it's a write access */ | 1775 | /* ..except if it's a write access */ |
1777 | if (write_access) { | 1776 | if (write_access) { |
1777 | struct page *page; | ||
1778 | |||
1778 | /* Allocate our own private page. */ | 1779 | /* Allocate our own private page. */ |
1779 | pte_unmap(page_table); | 1780 | pte_unmap(page_table); |
1780 | spin_unlock(&mm->page_table_lock); | 1781 | spin_unlock(&mm->page_table_lock); |