[PATCH 1/3] mm/page_ext: add common function to get client data from page_ext

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

 



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@xxxxxxxxxxxxxxx>
---
 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





[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