Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mm: move get_page_from_free_area() to mm/page_alloc.c

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>

authored by

Mike Rapoport (IBM) and committed by
Andrew Morton
5d671eb4 53d36a56

+7 -7
-7
include/linux/mmzone.h
··· 108 108 unsigned long nr_free; 109 109 }; 110 110 111 - static inline struct page *get_page_from_free_area(struct free_area *area, 112 - int migratetype) 113 - { 114 - return list_first_entry_or_null(&area->free_list[migratetype], 115 - struct page, lru); 116 - } 117 - 118 111 static inline bool free_area_empty(struct free_area *area, int migratetype) 119 112 { 120 113 return list_empty(&area->free_list[migratetype]);
+7
mm/page_alloc.c
··· 1048 1048 zone->free_area[order].nr_free--; 1049 1049 } 1050 1050 1051 + static inline struct page *get_page_from_free_area(struct free_area *area, 1052 + int migratetype) 1053 + { 1054 + return list_first_entry_or_null(&area->free_list[migratetype], 1055 + struct page, lru); 1056 + } 1057 + 1051 1058 /* 1052 1059 * If this is not the largest possible page, check if the buddy 1053 1060 * of the next-highest order is free. If it is, it's possible