diff options
author | Mark Brown <broonie@linaro.org> | 2013-07-19 10:30:43 +0100 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-07-19 10:30:43 +0100 |
commit | 0a37d59e3c8c2299f8931df0cb1c0f525047fab5 (patch) | |
tree | 932ce8b019e13274910111b9b944f050d3d36c63 /include/linux/hugetlb.h | |
parent | 9bca3d7f7c5865700303e8bce0eac57bab76bcc7 (diff) | |
parent | cb5d8be972cfbea114ea56fd63ed5ce1644863df (diff) |
Merge tag 'v3.10.1' into linux-linaro-lsk
This is the 3.10.1 stable release
Diffstat (limited to 'include/linux/hugetlb.h')
-rw-r--r-- | include/linux/hugetlb.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 6b4890fa57e..feaf0c7fb7d 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -358,6 +358,17 @@ static inline int hstate_index(struct hstate *h) return h - hstates; } +pgoff_t __basepage_index(struct page *page); + +/* Return page->index in PAGE_SIZE units */ +static inline pgoff_t basepage_index(struct page *page) +{ + if (!PageCompound(page)) + return page->index; + + return __basepage_index(page); +} + #else /* CONFIG_HUGETLB_PAGE */ struct hstate {}; #define alloc_huge_page_node(h, nid) NULL @@ -378,6 +389,11 @@ static inline unsigned int pages_per_huge_page(struct hstate *h) } #define hstate_index_to_shift(index) 0 #define hstate_index(h) 0 + +static inline pgoff_t basepage_index(struct page *page) +{ + return page->index; +} #endif /* CONFIG_HUGETLB_PAGE */ #endif /* _LINUX_HUGETLB_H */ |