[PATCH] m68k: kill mach_floppy_setup, convert to proper __setup() in drivers
[linux-2.6.git] / arch / x86_64 / mm / pageattr.c
index 94862e1ec032d2616ca270071e70fb523e1aa150..35f1f1aab0638ac41699ec718980c26fd40b383d 100644 (file)
@@ -128,6 +128,7 @@ __change_page_attr(unsigned long address, unsigned long pfn, pgprot_t prot,
        pte_t *kpte; 
        struct page *kpte_page;
        unsigned kpte_flags;
+       pgprot_t ref_prot2;
        kpte = lookup_address(address);
        if (!kpte) return 0;
        kpte_page = virt_to_page(((unsigned long)kpte) & PAGE_MASK);
@@ -140,10 +141,14 @@ __change_page_attr(unsigned long address, unsigned long pfn, pgprot_t prot,
                         * split_large_page will take the reference for this change_page_attr
                         * on the split page.
                         */
-                       struct page *split = split_large_page(address, prot, ref_prot); 
+
+                       struct page *split;
+                       ref_prot2 = __pgprot(pgprot_val(pte_pgprot(*lookup_address(address))) & ~(1<<_PAGE_BIT_PSE));
+
+                       split = split_large_page(address, prot, ref_prot2);
                        if (!split)
                                return -ENOMEM;
-                       set_pte(kpte,mk_pte(split, ref_prot));
+                       set_pte(kpte,mk_pte(split, ref_prot2));
                        kpte_page = split;
                }       
                get_page(kpte_page);
@@ -220,8 +225,6 @@ void global_flush_tlb(void)
        down_read(&init_mm.mmap_sem);
        df = xchg(&df_list, NULL);
        up_read(&init_mm.mmap_sem);
-       if (!df)
-               return;
        flush_map((df && !df->next) ? df->address : 0);
        for (; df; df = next_df) { 
                next_df = df->next;