diff mbox series

[03/10] mm: Make page_ext_get() take a const argument

Message ID 20240326171045.410737-4-willy@infradead.org (mailing list archive)
State New
Headers show
Series Various page->flags cleanups | expand

Commit Message

Matthew Wilcox March 26, 2024, 5:10 p.m. UTC
In order to constify other functions, we need page_ext_get() to be const.
This is no problem as lookup_page_ext() already takes a const argument.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 include/linux/page_ext.h    | 4 ++--
 include/linux/pgalloc_tag.h | 2 --
 mm/page_ext.c               | 2 +-
 3 files changed, 3 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/include/linux/page_ext.h b/include/linux/page_ext.h
index 07e0656898f9..e4b48a0dda24 100644
--- a/include/linux/page_ext.h
+++ b/include/linux/page_ext.h
@@ -77,7 +77,7 @@  static inline void page_ext_init(void)
 }
 #endif
 
-extern struct page_ext *page_ext_get(struct page *page);
+extern struct page_ext *page_ext_get(const struct page *page);
 extern void page_ext_put(struct page_ext *page_ext);
 
 static inline void *page_ext_data(struct page_ext *page_ext,
@@ -117,7 +117,7 @@  static inline void page_ext_init_flatmem(void)
 {
 }
 
-static inline struct page_ext *page_ext_get(struct page *page)
+static inline struct page_ext *page_ext_get(const struct page *page)
 {
 	return NULL;
 }
diff --git a/include/linux/pgalloc_tag.h b/include/linux/pgalloc_tag.h
index 62d8dad74b37..86ba5d33e43b 100644
--- a/include/linux/pgalloc_tag.h
+++ b/include/linux/pgalloc_tag.h
@@ -12,8 +12,6 @@ 
 #include <linux/page_ext.h>
 
 extern struct page_ext_operations page_alloc_tagging_ops;
-extern struct page_ext *page_ext_get(struct page *page);
-extern void page_ext_put(struct page_ext *page_ext);
 
 static inline union codetag_ref *codetag_ref_from_page_ext(struct page_ext *page_ext)
 {
diff --git a/mm/page_ext.c b/mm/page_ext.c
index e7d8f1a5589e..95dd8ffeaf81 100644
--- a/mm/page_ext.c
+++ b/mm/page_ext.c
@@ -514,7 +514,7 @@  void __meminit pgdat_page_ext_init(struct pglist_data *pgdat)
  * Context: Any context.  Caller may not sleep until they have called
  * page_ext_put().
  */
-struct page_ext *page_ext_get(struct page *page)
+struct page_ext *page_ext_get(const struct page *page)
 {
 	struct page_ext *page_ext;