diff mbox series

[v2,07/10] mm: memory: use a folio in do_set_pmd()

Message ID 20231104035522.2418660-8-wangkefeng.wang@huawei.com (mailing list archive)
State New
Headers show
Series mm: convert mm counter to take a folio | expand

Commit Message

Kefeng Wang Nov. 4, 2023, 3:55 a.m. UTC
Use a folio in do_set_pmd(), which is a preparetion for
converting mm counter functions to take a folio.

Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 mm/memory.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/mm/memory.c b/mm/memory.c
index 806568f9605b..ac247850919a 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -4318,12 +4318,13 @@  vm_fault_t do_set_pmd(struct vm_fault *vmf, struct page *page)
 	unsigned long haddr = vmf->address & HPAGE_PMD_MASK;
 	pmd_t entry;
 	vm_fault_t ret = VM_FAULT_FALLBACK;
+	struct folio *folio;
 
 	if (!transhuge_vma_suitable(vma, haddr))
 		return ret;
 
-	page = compound_head(page);
-	if (compound_order(page) != HPAGE_PMD_ORDER)
+	folio = page_folio(page);
+	if (folio_order(folio) != HPAGE_PMD_ORDER)
 		return ret;
 
 	/*