|
@@ -3660,7 +3660,20 @@ pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr)
|
|
return (pte_t *) pmd;
|
|
return (pte_t *) pmd;
|
|
}
|
|
}
|
|
|
|
|
|
-struct page *
|
|
|
|
|
|
+#endif /* CONFIG_ARCH_WANT_GENERAL_HUGETLB */
|
|
|
|
+
|
|
|
|
+/*
|
|
|
|
+ * These functions are overwritable if your architecture needs its own
|
|
|
|
+ * behavior.
|
|
|
|
+ */
|
|
|
|
+struct page * __weak
|
|
|
|
+follow_huge_addr(struct mm_struct *mm, unsigned long address,
|
|
|
|
+ int write)
|
|
|
|
+{
|
|
|
|
+ return ERR_PTR(-EINVAL);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+struct page * __weak
|
|
follow_huge_pmd(struct mm_struct *mm, unsigned long address,
|
|
follow_huge_pmd(struct mm_struct *mm, unsigned long address,
|
|
pmd_t *pmd, int write)
|
|
pmd_t *pmd, int write)
|
|
{
|
|
{
|
|
@@ -3672,7 +3685,7 @@ follow_huge_pmd(struct mm_struct *mm, unsigned long address,
|
|
return page;
|
|
return page;
|
|
}
|
|
}
|
|
|
|
|
|
-struct page *
|
|
|
|
|
|
+struct page * __weak
|
|
follow_huge_pud(struct mm_struct *mm, unsigned long address,
|
|
follow_huge_pud(struct mm_struct *mm, unsigned long address,
|
|
pud_t *pud, int write)
|
|
pud_t *pud, int write)
|
|
{
|
|
{
|
|
@@ -3684,19 +3697,6 @@ follow_huge_pud(struct mm_struct *mm, unsigned long address,
|
|
return page;
|
|
return page;
|
|
}
|
|
}
|
|
|
|
|
|
-#else /* !CONFIG_ARCH_WANT_GENERAL_HUGETLB */
|
|
|
|
-
|
|
|
|
-/* Can be overriden by architectures */
|
|
|
|
-struct page * __weak
|
|
|
|
-follow_huge_pud(struct mm_struct *mm, unsigned long address,
|
|
|
|
- pud_t *pud, int write)
|
|
|
|
-{
|
|
|
|
- BUG();
|
|
|
|
- return NULL;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-#endif /* CONFIG_ARCH_WANT_GENERAL_HUGETLB */
|
|
|
|
-
|
|
|
|
#ifdef CONFIG_MEMORY_FAILURE
|
|
#ifdef CONFIG_MEMORY_FAILURE
|
|
|
|
|
|
/* Should be called in hugetlb_lock */
|
|
/* Should be called in hugetlb_lock */
|