md: linear: Make array_size sector-based and rename it to array_sectors.
[pandora-kernel.git] / mm / mprotect.c
index e8346c3..a5bf31c 100644 (file)
 #include <asm/cacheflush.h>
 #include <asm/tlbflush.h>
 
+#ifndef pgprot_modify
+static inline pgprot_t pgprot_modify(pgprot_t oldprot, pgprot_t newprot)
+{
+       return newprot;
+}
+#endif
+
 static void change_pte_range(struct mm_struct *mm, pmd_t *pmd,
                unsigned long addr, unsigned long end, pgprot_t newprot,
                int dirty_accountable)
@@ -53,7 +60,6 @@ static void change_pte_range(struct mm_struct *mm, pmd_t *pmd,
                        if (dirty_accountable && pte_dirty(ptent))
                                ptent = pte_mkwrite(ptent);
                        set_pte_at(mm, addr, pte, ptent);
-                       lazy_mmu_prot_update(ptent);
 #ifdef CONFIG_MIGRATION
                } else if (!pte_file(oldpte)) {
                        swp_entry_t entry = pte_to_swp_entry(oldpte);
@@ -193,11 +199,11 @@ 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 = pgprot_modify(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 & ~VM_SHARED);
                dirty_accountable = 1;
        }