break;
                        }
                } else if (vma && hva >= vma->vm_start &&
-                          (vma->vm_flags & VM_HUGETLB)) {
+                          is_vm_hugetlb_page(vma)) {
                        unsigned long psize = vma_kernel_pagesize(vma);
 
                        tsize = (gtlbe->mas1 & MAS1_TSIZE_MASK) >>
 
 #include <linux/highuid.h>
 #include <linux/compiler.h>
 #include <linux/highmem.h>
+#include <linux/hugetlb.h>
 #include <linux/pagemap.h>
 #include <linux/vmalloc.h>
 #include <linux/security.h>
        }
 
        /* Hugetlb memory check */
-       if (vma->vm_flags & VM_HUGETLB) {
+       if (is_vm_hugetlb_page(vma)) {
                if ((vma->vm_flags & VM_SHARED) && FILTER(HUGETLB_SHARED))
                        goto whole;
                if (!(vma->vm_flags & VM_SHARED) && FILTER(HUGETLB_PRIVATE))
 
 
 #include <linux/mmu_notifier.h>
 #include <linux/swap.h>
+#include <linux/hugetlb_inline.h>
 #include <asm/pgalloc.h>
 #include <asm/tlbflush.h>
 #include <asm/cacheflush.h>
         * We rely on tlb_end_vma() to issue a flush, such that when we reset
         * these values the batch is empty.
         */
-       tlb->vma_huge = !!(vma->vm_flags & VM_HUGETLB);
+       tlb->vma_huge = is_vm_hugetlb_page(vma);
        tlb->vma_exec = !!(vma->vm_flags & VM_EXEC);
 }
 
 
 #include <linux/export.h>
 #include <linux/vmalloc.h>
 #include <linux/hardirq.h>
+#include <linux/hugetlb.h>
 #include <linux/rculist.h>
 #include <linux/uaccess.h>
 #include <linux/syscalls.h>
                flags |= MAP_EXECUTABLE;
        if (vma->vm_flags & VM_LOCKED)
                flags |= MAP_LOCKED;
-       if (vma->vm_flags & VM_HUGETLB)
+       if (is_vm_hugetlb_page(vma))
                flags |= MAP_HUGETLB;
 
        if (file) {