mm: move get_page_from_free_area() to mm/page_alloc.c
authorMike Rapoport (IBM) <rppt@kernel.org>
Sun, 19 Mar 2023 11:42:14 +0000 (13:42 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 6 Apr 2023 02:42:51 +0000 (19:42 -0700)
The get_page_from_free_area() helper is only used in mm/page_alloc.c so
move it there to reduce noise in include/linux/mmzone.h

Link: https://lkml.kernel.org/r/20230319114214.2133332-1-rppt@kernel.org
Signed-off-by: Mike Rapoport (IBM) <rppt@kernel.org>
Reviewed-by: Lorenzo Stoakes <lstoakes@gmail.com>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/mmzone.h
mm/page_alloc.c

index 35b11cc210d962288cbf7dc6c5c9f7549bfd9114..2d3d78d0128335368d130336f6d2efd4cde38500 100644 (file)
@@ -108,13 +108,6 @@ struct free_area {
        unsigned long           nr_free;
 };
 
-static inline struct page *get_page_from_free_area(struct free_area *area,
-                                           int migratetype)
-{
-       return list_first_entry_or_null(&area->free_list[migratetype],
-                                       struct page, lru);
-}
-
 static inline bool free_area_empty(struct free_area *area, int migratetype)
 {
        return list_empty(&area->free_list[migratetype]);
index c3e49d028a7ac5eb920b9e5ed49166cabad9aa72..4b09711b6f0feaf7862e867a75d24db436d305eb 100644 (file)
@@ -1048,6 +1048,13 @@ static inline void del_page_from_free_list(struct page *page, struct zone *zone,
        zone->free_area[order].nr_free--;
 }
 
+static inline struct page *get_page_from_free_area(struct free_area *area,
+                                           int migratetype)
+{
+       return list_first_entry_or_null(&area->free_list[migratetype],
+                                       struct page, lru);
+}
+
 /*
  * If this is not the largest possible page, check if the buddy
  * of the next-highest order is free. If it is, it's possible