aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/huge_mm.h
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2020-08-14 17:30:37 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2020-08-14 19:56:56 -0700
commit6c357848b44b4016ca422178aa368a7472245f6f (patch)
treeed90c2a84790edf7daf695d8f9fb5c92ca656ff1 /include/linux/huge_mm.h
parentmm: add thp_size (diff)
downloadwireguard-linux-6c357848b44b4016ca422178aa368a7472245f6f.tar.xz
wireguard-linux-6c357848b44b4016ca422178aa368a7472245f6f.zip
mm: replace hpage_nr_pages with thp_nr_pages
The thp prefix is more frequently used than hpage and we should be consistent between the various functions. [akpm@linux-foundation.org: fix mm/migrate.c] Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Reviewed-by: William Kucharski <william.kucharski@oracle.com> Reviewed-by: Zi Yan <ziy@nvidia.com> Cc: Mike Kravetz <mike.kravetz@oracle.com> Cc: David Hildenbrand <david@redhat.com> Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> Link: http://lkml.kernel.org/r/20200629151959.15779-6-willy@infradead.org Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/huge_mm.h')
-rw-r--r--include/linux/huge_mm.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h
index 9b33ac774fdd..229f986d535a 100644
--- a/include/linux/huge_mm.h
+++ b/include/linux/huge_mm.h
@@ -271,9 +271,14 @@ static inline unsigned int thp_order(struct page *page)
return 0;
}
-static inline int hpage_nr_pages(struct page *page)
+/**
+ * thp_nr_pages - The number of regular pages in this huge page.
+ * @page: The head page of a huge page.
+ */
+static inline int thp_nr_pages(struct page *page)
{
- if (unlikely(PageTransHuge(page)))
+ VM_BUG_ON_PGFLAGS(PageTail(page), page);
+ if (PageHead(page))
return HPAGE_PMD_NR;
return 1;
}
@@ -336,9 +341,9 @@ static inline unsigned int thp_order(struct page *page)
return 0;
}
-static inline int hpage_nr_pages(struct page *page)
+static inline int thp_nr_pages(struct page *page)
{
- VM_BUG_ON_PAGE(PageTail(page), page);
+ VM_BUG_ON_PGFLAGS(PageTail(page), page);
return 1;
}