mm: make page_ext_get() take a const argument
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Tue, 26 Mar 2024 17:10:25 +0000 (17:10 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 26 Apr 2024 03:56:14 +0000 (20:56 -0700)
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.

Link: https://lkml.kernel.org/r/20240326171045.410737-4-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/page_ext.h
include/linux/pgalloc_tag.h
mm/page_ext.c

index 07e0656898f982614da4904effd1e197019d2eed..e4b48a0dda244627c9e401e6d1ddf2d9f5db0d59 100644 (file)
@@ -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;
 }
index 62d8dad74b373100bd6d6bd5b0791349b0d53a3f..86ba5d33e43bdf530f3cc9ffc1d1a28c2ce5a210 100644 (file)
@@ -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)
 {
index e7d8f1a5589ed1002100411413a045044017f901..95dd8ffeaf811a02b09784e238a5331363904aa9 100644 (file)
@@ -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;