aboutsummaryrefslogtreecommitdiff
path: root/include/linux/hugetlb.h
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-07-19 10:30:43 +0100
committerMark Brown <broonie@linaro.org>2013-07-19 10:30:43 +0100
commit0a37d59e3c8c2299f8931df0cb1c0f525047fab5 (patch)
tree932ce8b019e13274910111b9b944f050d3d36c63 /include/linux/hugetlb.h
parent9bca3d7f7c5865700303e8bce0eac57bab76bcc7 (diff)
parentcb5d8be972cfbea114ea56fd63ed5ce1644863df (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.h16
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 */