diff options
Diffstat (limited to 'include/linux/hugetlb.h')
-rw-r--r-- | include/linux/hugetlb.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index d5d6bbe2259e..217f52859fa7 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -302,6 +302,11 @@ static inline unsigned hstate_index_to_shift(unsigned index) | |||
302 | return hstates[index].order + PAGE_SHIFT; | 302 | return hstates[index].order + PAGE_SHIFT; |
303 | } | 303 | } |
304 | 304 | ||
305 | static inline int hstate_index(struct hstate *h) | ||
306 | { | ||
307 | return h - hstates; | ||
308 | } | ||
309 | |||
305 | #else | 310 | #else |
306 | struct hstate {}; | 311 | struct hstate {}; |
307 | #define alloc_huge_page_node(h, nid) NULL | 312 | #define alloc_huge_page_node(h, nid) NULL |
@@ -320,6 +325,7 @@ static inline unsigned int pages_per_huge_page(struct hstate *h) | |||
320 | return 1; | 325 | return 1; |
321 | } | 326 | } |
322 | #define hstate_index_to_shift(index) 0 | 327 | #define hstate_index_to_shift(index) 0 |
328 | #define hstate_index(h) 0 | ||
323 | #endif | 329 | #endif |
324 | 330 | ||
325 | #endif /* _LINUX_HUGETLB_H */ | 331 | #endif /* _LINUX_HUGETLB_H */ |