[PATCH v2 09/11] hugetlb: remove the hugetlb_linear_page_index() helper

From: Jane Chu

Date: Wed Jun 17 2026 - 13:28:33 EST


No one is calling hugetlb_linear_page_index(), so remove it.

Signed-off-by: Jane Chu <jane.chu@xxxxxxxxxx>
---
include/linux/hugetlb.h | 17 -----------------
1 file changed, 17 deletions(-)

diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index e78d0f706681..e5a459a6e4b2 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -787,23 +787,6 @@ static inline unsigned huge_page_shift(struct hstate *h)
return h->order + PAGE_SHIFT;
}

-/**
- * hugetlb_linear_page_index() - linear_page_index() but in hugetlb
- * page size granularity.
- * @vma: the hugetlb VMA
- * @address: the virtual address within the VMA
- *
- * Return: the page offset within the mapping in huge page units.
- */
-static inline pgoff_t hugetlb_linear_page_index(struct vm_area_struct *vma,
- unsigned long address)
-{
- struct hstate *h = hstate_vma(vma);
-
- return ((address - vma->vm_start) >> huge_page_shift(h)) +
- (vma->vm_pgoff >> huge_page_order(h));
-}
-
static inline bool order_is_gigantic(unsigned int order)
{
return order > MAX_PAGE_ORDER;
--
2.43.5