diff options
Diffstat (limited to 'include/linux/hugetlb.h')
-rw-r--r-- | include/linux/hugetlb.h | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 6b4890fa57e7..c2b1801a160b 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -55,7 +55,6 @@ void __unmap_hugepage_range_final(struct mmu_gather *tlb, | |||
55 | void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct *vma, | 55 | void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct *vma, |
56 | unsigned long start, unsigned long end, | 56 | unsigned long start, unsigned long end, |
57 | struct page *ref_page); | 57 | struct page *ref_page); |
58 | int hugetlb_prefault(struct address_space *, struct vm_area_struct *); | ||
59 | void hugetlb_report_meminfo(struct seq_file *); | 58 | void hugetlb_report_meminfo(struct seq_file *); |
60 | int hugetlb_report_node_meminfo(int, char *); | 59 | int hugetlb_report_node_meminfo(int, char *); |
61 | void hugetlb_show_meminfo(void); | 60 | void hugetlb_show_meminfo(void); |
@@ -69,6 +68,10 @@ void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed); | |||
69 | int dequeue_hwpoisoned_huge_page(struct page *page); | 68 | int dequeue_hwpoisoned_huge_page(struct page *page); |
70 | void copy_huge_page(struct page *dst, struct page *src); | 69 | void copy_huge_page(struct page *dst, struct page *src); |
71 | 70 | ||
71 | #ifdef CONFIG_ARCH_WANT_HUGE_PMD_SHARE | ||
72 | pte_t *huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud); | ||
73 | #endif | ||
74 | |||
72 | extern unsigned long hugepages_treat_as_movable; | 75 | extern unsigned long hugepages_treat_as_movable; |
73 | extern const unsigned long hugetlb_zero, hugetlb_infinity; | 76 | extern const unsigned long hugetlb_zero, hugetlb_infinity; |
74 | extern int sysctl_hugetlb_shm_group; | 77 | extern int sysctl_hugetlb_shm_group; |
@@ -110,7 +113,6 @@ static inline unsigned long hugetlb_total_pages(void) | |||
110 | #define follow_hugetlb_page(m,v,p,vs,a,b,i,w) ({ BUG(); 0; }) | 113 | #define follow_hugetlb_page(m,v,p,vs,a,b,i,w) ({ BUG(); 0; }) |
111 | #define follow_huge_addr(mm, addr, write) ERR_PTR(-EINVAL) | 114 | #define follow_huge_addr(mm, addr, write) ERR_PTR(-EINVAL) |
112 | #define copy_hugetlb_page_range(src, dst, vma) ({ BUG(); 0; }) | 115 | #define copy_hugetlb_page_range(src, dst, vma) ({ BUG(); 0; }) |
113 | #define hugetlb_prefault(mapping, vma) ({ BUG(); 0; }) | ||
114 | static inline void hugetlb_report_meminfo(struct seq_file *m) | 116 | static inline void hugetlb_report_meminfo(struct seq_file *m) |
115 | { | 117 | { |
116 | } | 118 | } |
@@ -358,6 +360,17 @@ static inline int hstate_index(struct hstate *h) | |||
358 | return h - hstates; | 360 | return h - hstates; |
359 | } | 361 | } |
360 | 362 | ||
363 | pgoff_t __basepage_index(struct page *page); | ||
364 | |||
365 | /* Return page->index in PAGE_SIZE units */ | ||
366 | static inline pgoff_t basepage_index(struct page *page) | ||
367 | { | ||
368 | if (!PageCompound(page)) | ||
369 | return page->index; | ||
370 | |||
371 | return __basepage_index(page); | ||
372 | } | ||
373 | |||
361 | #else /* CONFIG_HUGETLB_PAGE */ | 374 | #else /* CONFIG_HUGETLB_PAGE */ |
362 | struct hstate {}; | 375 | struct hstate {}; |
363 | #define alloc_huge_page_node(h, nid) NULL | 376 | #define alloc_huge_page_node(h, nid) NULL |
@@ -378,6 +391,11 @@ static inline unsigned int pages_per_huge_page(struct hstate *h) | |||
378 | } | 391 | } |
379 | #define hstate_index_to_shift(index) 0 | 392 | #define hstate_index_to_shift(index) 0 |
380 | #define hstate_index(h) 0 | 393 | #define hstate_index(h) 0 |
394 | |||
395 | static inline pgoff_t basepage_index(struct page *page) | ||
396 | { | ||
397 | return page->index; | ||
398 | } | ||
381 | #endif /* CONFIG_HUGETLB_PAGE */ | 399 | #endif /* CONFIG_HUGETLB_PAGE */ |
382 | 400 | ||
383 | #endif /* _LINUX_HUGETLB_H */ | 401 | #endif /* _LINUX_HUGETLB_H */ |