lkml.org 
[lkml]   [2024]   [Feb]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 1/6] mm/migrate: introduce migrate_pfn_to_folio()
Date
Add a folio compatible wrapper for migrate_pfn_to_page() so we can
return a folio directly.

Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>
Suggested-by: Alistair Popple <apopple@nvidia.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

\
 
 \ /
  Last update: 2024-05-27 15:07    [W:0.149 / U:0.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site