powerpc/mm/hugetlb: Use pte_access_permitted for hugetlb access check
[linux-2.6-block.git] / arch / powerpc / mm / hugetlbpage.c
index a9b9083c5e4999bc398442ef3f8945040b47fac6..c7e5afe5e118e4a15b7e13cdf29bf999ba73c4b0 100644 (file)
@@ -855,9 +855,7 @@ int gup_hugepte(pte_t *ptep, unsigned long sz, unsigned long addr,
 
        pte = READ_ONCE(*ptep);
 
-       if (!pte_present(pte) || !pte_read(pte))
-               return 0;
-       if (write && !pte_write(pte))
+       if (!pte_access_permitted(pte, write))
                return 0;
 
        /* hugepages are never "special" */