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>
This commit is contained in:
parent
53d36a56d8
commit
5d671eb4ef
@ -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]);
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user