[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1241302572-4366-5-git-send-email-ieidus@redhat.com>
Date: Sun, 3 May 2009 01:16:10 +0300
From: Izik Eidus <ieidus@...hat.com>
To: akpm@...ux-foundation.org
Cc: linux-kernel@...r.kernel.org, aarcange@...hat.com,
chrisw@...hat.com, alan@...rguk.ukuu.org.uk, device@...ana.org,
linux-mm@...ck.org, hugh@...itas.com, nickpiggin@...oo.com.au,
Izik Eidus <ieidus@...hat.com>
Subject: [PATCH 4/6] ksm: change the prot handling to use the generic helper functions
This is needed to avoid breaking some architectures.
Signed-off-by: Izik Eidus <ieidus@...hat.com>
---
mm/ksm.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/mm/ksm.c b/mm/ksm.c
index c14019f..bfbbe1d 100644
--- a/mm/ksm.c
+++ b/mm/ksm.c
@@ -766,8 +766,8 @@ static int try_to_merge_two_pages_alloc(struct mm_struct *mm1,
up_read(&mm1->mmap_sem);
return ret;
}
- prot = vma->vm_page_prot;
- pgprot_val(prot) &= ~_PAGE_RW;
+
+ prot = vm_get_page_prot(vma->vm_flags & ~VM_WRITE);
copy_user_highpage(kpage, page1, addr1, vma);
ret = try_to_merge_one_page(mm1, vma, page1, kpage, prot);
@@ -784,8 +784,7 @@ static int try_to_merge_two_pages_alloc(struct mm_struct *mm1,
return ret;
}
- prot = vma->vm_page_prot;
- pgprot_val(prot) &= ~_PAGE_RW;
+ prot = vm_get_page_prot(vma->vm_flags & ~VM_WRITE);
ret = try_to_merge_one_page(mm2, vma, page2, kpage,
prot);
@@ -831,8 +830,9 @@ static int try_to_merge_two_pages_noalloc(struct mm_struct *mm1,
up_read(&mm1->mmap_sem);
return ret;
}
- prot = vma->vm_page_prot;
- pgprot_val(prot) &= ~_PAGE_RW;
+
+ prot = vm_get_page_prot(vma->vm_flags & ~VM_WRITE);
+
ret = try_to_merge_one_page(mm1, vma, page1, page2, prot);
up_read(&mm1->mmap_sem);
if (!ret)
--
1.5.6.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists