]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/mm/hugetlbpage.c
x86: stricter check in follow_huge_addr()
[linux-2.6-omap-h63xx.git] / arch / x86 / mm / hugetlbpage.c
index 6c06d9c0488ec28c05d45c226d77c1050a7394a8..0b3d567e686df15c1b042deb388091ab78a6ae25 100644 (file)
@@ -15,6 +15,7 @@
 #include <asm/mman.h>
 #include <asm/tlb.h>
 #include <asm/tlbflush.h>
+#include <asm/pgalloc.h>
 
 static unsigned long page_table_shareable(struct vm_area_struct *svma,
                                struct vm_area_struct *vma,
@@ -88,7 +89,7 @@ static void huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud)
 
        spin_lock(&mm->page_table_lock);
        if (pud_none(*pud))
-               pud_populate(mm, pud, (unsigned long) spte & PAGE_MASK);
+               pud_populate(mm, pud, (pmd_t *)((unsigned long)spte & PAGE_MASK));
        else
                put_page(virt_to_page(spte));
        spin_unlock(&mm->page_table_lock);
@@ -177,7 +178,7 @@ follow_huge_addr(struct mm_struct *mm, unsigned long address, int write)
 
        page = &pte_page(*pte)[vpfn % (HPAGE_SIZE/PAGE_SIZE)];
 
-       WARN_ON(!PageCompound(page));
+       WARN_ON(!PageHead(page));
 
        return page;
 }