diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2017-12-04 07:49:10 +0530 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2017-12-22 22:28:31 +1100 |
commit | 5fa5b16be5b319184378870467352eab6700b1de (patch) | |
tree | c602b0f4ba3053b3f596e1f9575bb361528912f7 /arch/powerpc/mm/hugetlbpage.c | |
parent | 7e4363550c2599a90f55fe3c538a7cf99fe4f473 (diff) | |
download | linux-stable-5fa5b16be5b319184378870467352eab6700b1de.tar.gz linux-stable-5fa5b16be5b319184378870467352eab6700b1de.tar.bz2 linux-stable-5fa5b16be5b319184378870467352eab6700b1de.zip |
powerpc/mm/hugetlb: Use pte_access_permitted for hugetlb access check
No functional change in this patch. This update gup_hugepte to use the
helper. This will help later when we add memory keys.
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/mm/hugetlbpage.c')
-rw-r--r-- | arch/powerpc/mm/hugetlbpage.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c index a9b9083c5e49..c7e5afe5e118 100644 --- a/arch/powerpc/mm/hugetlbpage.c +++ b/arch/powerpc/mm/hugetlbpage.c @@ -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" */ |