On Wed, 4 May 2022 19:28:39 +0100 "Matthew Wilcox (Oracle)" <willy@xxxxxxxxxxxxx> wrote: > The only caller already has a folio available, so this saves a conversion. > Also convert the return type to boolean. > > ... > > --- a/include/linux/swap.h > +++ b/include/linux/swap.h > @@ -449,7 +449,7 @@ static inline unsigned long total_swapcache_pages(void) > } > > extern void show_swap_cache_info(void); > -extern int add_to_swap(struct page *page); > +bool add_to_swap(struct folio *folio); > extern void *get_shadow_from_swap_cache(swp_entry_t entry); > extern int add_to_swap_cache(struct page *page, swp_entry_t entry, > gfp_t gfp, void **shadowp); > @@ -630,9 +630,9 @@ struct page *find_get_incore_page(struct address_space *mapping, pgoff_t index) > return find_get_page(mapping, index); > } > > -static inline int add_to_swap(struct page *page) > +static inline bool add_to_swap(struct folio *folio) > { > - return 0; > + return false; > } > Neil's "mm: create new mm/swap.h header file" moved this to mm/swap.h. Simple enough. But mm/swap.h now gets its first mention of a folio yet it includes no prerequisites. I guess the includer is responsible for including the correct headers first, which is pretty sad, My fingers are itching to add a forward declaration `struct folio;', but I assume that isn't needed. We'll find out soon enough ;)