[PATCH v2 1/6] mm/migrate: introduce migrate_pfn_to_folio()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add a folio compatible wrapper for migrate_pfn_to_page() so we can
return a folio directly.

Signed-off-by: Sidhartha Kumar <sidhartha.kumar@xxxxxxxxxx>
Suggested-by: Alistair Popple <apopple@xxxxxxxxxx>
---
 include/linux/migrate.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/linux/migrate.h b/include/linux/migrate.h
index 2ce13e8a309bd..21a1a5e415338 100644
--- a/include/linux/migrate.h
+++ b/include/linux/migrate.h
@@ -171,6 +171,11 @@ static inline struct page *migrate_pfn_to_page(unsigned long mpfn)
 	return pfn_to_page(mpfn >> MIGRATE_PFN_SHIFT);
 }
 
+static inline struct folio *migrate_pfn_to_folio(unsigned long mpfn)
+{
+	return page_folio(migrate_pfn_to_page(mpfn));
+}
+
 static inline unsigned long migrate_pfn(unsigned long pfn)
 {
 	return (pfn << MIGRATE_PFN_SHIFT) | MIGRATE_PFN_VALID;
-- 
2.42.0





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux