diff options
Diffstat (limited to 'mm/hugetlb.c')
-rw-r--r-- | mm/hugetlb.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 2130365d387d..dee6cf4e6d34 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c | |||
@@ -702,6 +702,23 @@ int PageHuge(struct page *page) | |||
702 | } | 702 | } |
703 | EXPORT_SYMBOL_GPL(PageHuge); | 703 | EXPORT_SYMBOL_GPL(PageHuge); |
704 | 704 | ||
705 | /* | ||
706 | * PageHeadHuge() only returns true for hugetlbfs head page, but not for | ||
707 | * normal or transparent huge pages. | ||
708 | */ | ||
709 | int PageHeadHuge(struct page *page_head) | ||
710 | { | ||
711 | compound_page_dtor *dtor; | ||
712 | |||
713 | if (!PageHead(page_head)) | ||
714 | return 0; | ||
715 | |||
716 | dtor = get_compound_page_dtor(page_head); | ||
717 | |||
718 | return dtor == free_huge_page; | ||
719 | } | ||
720 | EXPORT_SYMBOL_GPL(PageHeadHuge); | ||
721 | |||
705 | pgoff_t __basepage_index(struct page *page) | 722 | pgoff_t __basepage_index(struct page *page) |
706 | { | 723 | { |
707 | struct page *page_head = compound_head(page); | 724 | struct page *page_head = compound_head(page); |