From 3ed75eb8f1cd89565966599c4f77d2edb086d5b0 Mon Sep 17 00:00:00 2001 From: Coly Li Date: Thu, 18 Oct 2007 23:39:15 -0700 Subject: setup vma->vm_page_prot by vm_get_page_prot() This patch uses vm_get_page_prot() to setup vma->vm_page_prot. Though inside vm_get_page_prot() the protection flags is AND with (VM_READ|VM_WRITE|VM_EXEC|VM_SHARED), it does not hurt correct code. Signed-off-by: Coly Li Cc: Hugh Dickins Cc: Tony Luck Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- mm/mprotect.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'mm/mprotect.c') diff --git a/mm/mprotect.c b/mm/mprotect.c index 1d4d69790e59..55227845abbe 100644 --- a/mm/mprotect.c +++ b/mm/mprotect.c @@ -192,11 +192,9 @@ success: * held in write mode. */ vma->vm_flags = newflags; - vma->vm_page_prot = protection_map[newflags & - (VM_READ|VM_WRITE|VM_EXEC|VM_SHARED)]; + vma->vm_page_prot = vm_get_page_prot(newflags); if (vma_wants_writenotify(vma)) { - vma->vm_page_prot = protection_map[newflags & - (VM_READ|VM_WRITE|VM_EXEC)]; + vma->vm_page_prot = vm_get_page_prot(newflags); dirty_accountable = 1; } -- cgit v1.2.3-58-ga151