mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-19 16:39:31 +01:00
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 <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
This commit is contained in:
1 parent
7e4363550c
commit
5fa5b16be5
1 file changed
+1
-3
@@ -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" */
|
||||
|
||||
Reference in new issue
Block a user