[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240216211320.222431-1-sidhartha.kumar@oracle.com>
Date: Fri, 16 Feb 2024 13:13:15 -0800
From: Sidhartha Kumar <sidhartha.kumar@...cle.com>
To: linux-kernel@...r.kernel.org, linux-mm@...ck.org
Cc: akpm@...ux-foundation.org, willy@...radead.org, apopple@...dia.com,
Sidhartha Kumar <sidhartha.kumar@...cle.com>
Subject: [PATCH v2 1/6] mm/migrate: introduce migrate_pfn_to_folio()
Add a folio compatible wrapper for migrate_pfn_to_page() so we can
return a folio directly.
Signed-off-by: Sidhartha Kumar <sidhartha.kumar@...cle.com>
Suggested-by: Alistair Popple <apopple@...dia.com>
---
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
Powered by blists - more mailing lists