[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230718145812.1991717-2-shikemeng@huaweicloud.com>
Date: Tue, 18 Jul 2023 22:58:10 +0800
From: Kemeng Shi <shikemeng@...weicloud.com>
To: akpm@...ux-foundation.org, pasha.tatashin@...een.com,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Cc: shikemeng@...weicloud.com
Subject: [PATCH 1/3] mm/page_ext: add common function to get client data from page_ext
Add common page_ext_data function to get client data. This could hide
offset which is auto generated in page_ext core and expose the desgin
of page_ext data layout.
Signed-off-by: Kemeng Shi <shikemeng@...weicloud.com>
---
include/linux/page_ext.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/include/linux/page_ext.h b/include/linux/page_ext.h
index 8dd21d87e0da..be98564191e6 100644
--- a/include/linux/page_ext.h
+++ b/include/linux/page_ext.h
@@ -81,6 +81,12 @@ static inline void page_ext_init(void)
extern struct page_ext *page_ext_get(struct page *page);
extern void page_ext_put(struct page_ext *page_ext);
+static inline void *page_ext_data(struct page_ext *page_ext,
+ struct page_ext_operations *ops)
+{
+ return (void *)(page_ext) + ops->offset;
+}
+
static inline struct page_ext *page_ext_next(struct page_ext *curr)
{
void *next = curr;
--
2.30.0
Powered by blists - more mailing lists