}
static int
-__change_page_attr(unsigned long address, unsigned long pfn, pgprot_t prot)
+__change_page_attr(unsigned long address, struct page *page, pgprot_t prot)
{
struct page *kpte_page;
pte_t *kpte;
prot = canon_pgprot(prot);
if (level == 4) {
- set_pte(kpte, pfn_pte(pfn, prot));
+ set_pte(kpte, mk_pte(page, prot));
} else {
/*
* split_large_page will take the reference for this
unsigned long pfn = __pa(address) >> PAGE_SHIFT;
if (!kernel_map || pte_present(pfn_pte(0, prot))) {
- err = __change_page_attr(address, pfn, prot);
+ err = __change_page_attr(address, pfn_to_page(pfn), prot);
if (err)
break;
}
addr2 = __START_KERNEL_map + __pa(address);
/* Make sure the kernel mappings stay executable */
prot2 = pte_pgprot(pte_mkexec(pfn_pte(0, prot)));
- err = __change_page_attr(addr2, pfn, prot2);
+ err = __change_page_attr(addr2, pfn_to_page(pfn), prot2);
}
}
up_write(&init_mm.mmap_sem);