diff options
Diffstat (limited to 'include/linux/hugetlb.h')
-rw-r--r-- | include/linux/hugetlb.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 5db25ffdb3eb..d6f1019625af 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -36,7 +36,6 @@ struct page *follow_huge_addr(struct mm_struct *mm, unsigned long address, | |||
36 | int write); | 36 | int write); |
37 | struct page *follow_huge_pmd(struct mm_struct *mm, unsigned long address, | 37 | struct page *follow_huge_pmd(struct mm_struct *mm, unsigned long address, |
38 | pmd_t *pmd, int write); | 38 | pmd_t *pmd, int write); |
39 | int is_aligned_hugepage_range(unsigned long addr, unsigned long len); | ||
40 | int pmd_huge(pmd_t pmd); | 39 | int pmd_huge(pmd_t pmd); |
41 | void hugetlb_change_protection(struct vm_area_struct *vma, | 40 | void hugetlb_change_protection(struct vm_area_struct *vma, |
42 | unsigned long address, unsigned long end, pgprot_t newprot); | 41 | unsigned long address, unsigned long end, pgprot_t newprot); |
@@ -54,8 +53,18 @@ void hugetlb_free_pgd_range(struct mmu_gather **tlb, unsigned long addr, | |||
54 | #endif | 53 | #endif |
55 | 54 | ||
56 | #ifndef ARCH_HAS_PREPARE_HUGEPAGE_RANGE | 55 | #ifndef ARCH_HAS_PREPARE_HUGEPAGE_RANGE |
57 | #define prepare_hugepage_range(addr, len) \ | 56 | /* |
58 | is_aligned_hugepage_range(addr, len) | 57 | * If the arch doesn't supply something else, assume that hugepage |
58 | * size aligned regions are ok without further preparation. | ||
59 | */ | ||
60 | static inline int prepare_hugepage_range(unsigned long addr, unsigned long len) | ||
61 | { | ||
62 | if (len & ~HPAGE_MASK) | ||
63 | return -EINVAL; | ||
64 | if (addr & ~HPAGE_MASK) | ||
65 | return -EINVAL; | ||
66 | return 0; | ||
67 | } | ||
59 | #else | 68 | #else |
60 | int prepare_hugepage_range(unsigned long addr, unsigned long len); | 69 | int prepare_hugepage_range(unsigned long addr, unsigned long len); |
61 | #endif | 70 | #endif |
@@ -95,7 +104,6 @@ static inline unsigned long hugetlb_total_pages(void) | |||
95 | #define hugetlb_report_meminfo(buf) 0 | 104 | #define hugetlb_report_meminfo(buf) 0 |
96 | #define hugetlb_report_node_meminfo(n, buf) 0 | 105 | #define hugetlb_report_node_meminfo(n, buf) 0 |
97 | #define follow_huge_pmd(mm, addr, pmd, write) NULL | 106 | #define follow_huge_pmd(mm, addr, pmd, write) NULL |
98 | #define is_aligned_hugepage_range(addr, len) 0 | ||
99 | #define prepare_hugepage_range(addr, len) (-EINVAL) | 107 | #define prepare_hugepage_range(addr, len) (-EINVAL) |
100 | #define pmd_huge(x) 0 | 108 | #define pmd_huge(x) 0 |
101 | #define is_hugepage_only_range(mm, addr, len) 0 | 109 | #define is_hugepage_only_range(mm, addr, len) 0 |