[PATCH 2/9] mm/hugetlb: convert hugetlbfs_pagecache_present() to folios

From: Sidhartha Kumar
Date: Thu Jan 19 2023 - 16:22:50 EST


Convert hugetlbfs_pagecache_present() to use folios internally by
replacing a call to find_get_page() to filemap_get_folio().

Signed-off-by: Sidhartha Kumar <sidhartha.kumar@xxxxxxxxxx>
---
mm/hugetlb.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 849206e94742..04cbdf5025a5 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -5653,15 +5653,15 @@ static bool hugetlbfs_pagecache_present(struct hstate *h,
{
struct address_space *mapping;
pgoff_t idx;
- struct page *page;
+ struct folio *folio;

mapping = vma->vm_file->f_mapping;
idx = vma_hugecache_offset(h, vma, address);

- page = find_get_page(mapping, idx);
- if (page)
- put_page(page);
- return page != NULL;
+ folio = filemap_get_folio(mapping, idx);
+ if (folio)
+ folio_put(folio);
+ return folio != NULL;
}

int hugetlb_add_to_page_cache(struct page *page, struct address_space *mapping,
--
2.39.0