diff options
Diffstat (limited to 'include/linux/hugetlb.h')
-rw-r--r-- | include/linux/hugetlb.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index ad2271e11f9b..b75bdb4deba3 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -36,8 +36,6 @@ int hugetlb_reserve_pages(struct inode *inode, long from, long to, | |||
36 | struct vm_area_struct *vma); | 36 | struct vm_area_struct *vma); |
37 | void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed); | 37 | void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed); |
38 | 38 | ||
39 | extern unsigned long max_huge_pages; | ||
40 | extern unsigned long sysctl_overcommit_huge_pages; | ||
41 | extern unsigned long hugepages_treat_as_movable; | 39 | extern unsigned long hugepages_treat_as_movable; |
42 | extern const unsigned long hugetlb_zero, hugetlb_infinity; | 40 | extern const unsigned long hugetlb_zero, hugetlb_infinity; |
43 | extern int sysctl_hugetlb_shm_group; | 41 | extern int sysctl_hugetlb_shm_group; |
@@ -181,7 +179,17 @@ struct hstate { | |||
181 | unsigned int surplus_huge_pages_node[MAX_NUMNODES]; | 179 | unsigned int surplus_huge_pages_node[MAX_NUMNODES]; |
182 | }; | 180 | }; |
183 | 181 | ||
184 | extern struct hstate default_hstate; | 182 | void __init hugetlb_add_hstate(unsigned order); |
183 | struct hstate *size_to_hstate(unsigned long size); | ||
184 | |||
185 | #ifndef HUGE_MAX_HSTATE | ||
186 | #define HUGE_MAX_HSTATE 1 | ||
187 | #endif | ||
188 | |||
189 | extern struct hstate hstates[HUGE_MAX_HSTATE]; | ||
190 | extern unsigned int default_hstate_idx; | ||
191 | |||
192 | #define default_hstate (hstates[default_hstate_idx]) | ||
185 | 193 | ||
186 | static inline struct hstate *hstate_vma(struct vm_area_struct *vma) | 194 | static inline struct hstate *hstate_vma(struct vm_area_struct *vma) |
187 | { | 195 | { |
@@ -230,6 +238,11 @@ static inline unsigned int blocks_per_huge_page(struct hstate *h) | |||
230 | 238 | ||
231 | #include <asm/hugetlb.h> | 239 | #include <asm/hugetlb.h> |
232 | 240 | ||
241 | static inline struct hstate *page_hstate(struct page *page) | ||
242 | { | ||
243 | return size_to_hstate(PAGE_SIZE << compound_order(page)); | ||
244 | } | ||
245 | |||
233 | #else | 246 | #else |
234 | struct hstate {}; | 247 | struct hstate {}; |
235 | #define hstate_file(f) NULL | 248 | #define hstate_file(f) NULL |