diff options
author | Matthew Wilcox (Oracle) <willy@infradead.org> | 2023-12-13 22:58:41 +0100 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2023-12-29 20:58:32 +0100 |
commit | 6e03492e9d288d9ce886064289e2768da5d7d967 (patch) | |
tree | 2754538a468fc8fbb91fcd5abc1e35720b67ec8e /mm/swap_state.c | |
parent | mm: remove page_swap_info() (diff) | |
download | linux-6e03492e9d288d9ce886064289e2768da5d7d967.tar.xz linux-6e03492e9d288d9ce886064289e2768da5d7d967.zip |
mm: return a folio from read_swap_cache_async()
The only two callers simply call put_page() on the page returned, so
they're happier calling folio_put(). Saves two calls to compound_head().
Link: https://lkml.kernel.org/r/20231213215842.671461-13-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to '')
-rw-r--r-- | mm/swap_state.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mm/swap_state.c b/mm/swap_state.c index d2fe70e307d9..97c8a950dd18 100644 --- a/mm/swap_state.c +++ b/mm/swap_state.c @@ -533,9 +533,9 @@ fail_put_swap: * __read_swap_cache_async() call them and swap_read_folio() holds the * swap cache folio lock. */ -struct page *read_swap_cache_async(swp_entry_t entry, gfp_t gfp_mask, - struct vm_area_struct *vma, - unsigned long addr, struct swap_iocb **plug) +struct folio *read_swap_cache_async(swp_entry_t entry, gfp_t gfp_mask, + struct vm_area_struct *vma, unsigned long addr, + struct swap_iocb **plug) { bool page_allocated; struct mempolicy *mpol; @@ -549,7 +549,7 @@ struct page *read_swap_cache_async(swp_entry_t entry, gfp_t gfp_mask, if (page_allocated) swap_read_folio(folio, false, plug); - return folio_file_page(folio, swp_offset(entry)); + return folio; } static unsigned int __swapin_nr_pages(unsigned long prev_offset, |