Skip to content

Commit

Permalink
[PATCH] pfnmap: remove src_page from do_wp_page
Browse files Browse the repository at this point in the history
Clean away do_wp_page's "src_page": cow_user_page makes it unnecessary.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Hugh Dickins authored and Linus Torvalds committed Nov 29, 2005
1 parent 5d2a2db commit e5bbe4d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions mm/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -1433,12 +1433,11 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct *vma,
unsigned long address, pte_t *page_table, pmd_t *pmd,
spinlock_t *ptl, pte_t orig_pte)
{
struct page *old_page, *src_page, *new_page;
struct page *old_page, *new_page;
pte_t entry;
int ret = VM_FAULT_MINOR;

old_page = vm_normal_page(vma, address, orig_pte);
src_page = old_page;
if (!old_page)
goto gotten;

Expand Down Expand Up @@ -1466,15 +1465,15 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct *vma,

if (unlikely(anon_vma_prepare(vma)))
goto oom;
if (src_page == ZERO_PAGE(address)) {
if (old_page == ZERO_PAGE(address)) {
new_page = alloc_zeroed_user_highpage(vma, address);
if (!new_page)
goto oom;
} else {
new_page = alloc_page_vma(GFP_HIGHUSER, vma, address);
if (!new_page)
goto oom;
cow_user_page(new_page, src_page, address);
cow_user_page(new_page, old_page, address);
}

/*
Expand Down

0 comments on commit e5bbe4d

Please sign in to comment.