]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - include/linux/page-flags.h
thp: transparent hugepage core
[mv-sheeva.git] / include / linux / page-flags.h
index 907f1605926b14cf550927f58d10c685dc668297..4ca1241ef94e0796ee1c092eea25a5514c873821 100644 (file)
@@ -410,11 +410,32 @@ static inline void ClearPageCompound(struct page *page)
 #endif /* !PAGEFLAGS_EXTENDED */
 
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
+/*
+ * PageHuge() only returns true for hugetlbfs pages, but not for
+ * normal or transparent huge pages.
+ *
+ * PageTransHuge() returns true for both transparent huge and
+ * hugetlbfs pages, but not normal pages. PageTransHuge() can only be
+ * called only in the core VM paths where hugetlbfs pages can't exist.
+ */
+static inline int PageTransHuge(struct page *page)
+{
+       VM_BUG_ON(PageTail(page));
+       return PageHead(page);
+}
+
 static inline int PageTransCompound(struct page *page)
 {
        return PageCompound(page);
 }
+
 #else
+
+static inline int PageTransHuge(struct page *page)
+{
+       return 0;
+}
+
 static inline int PageTransCompound(struct page *page)
 {
        return 0;