summaryrefslogtreecommitdiff
path: root/mm/page_io.c
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2023-12-13 21:58:31 +0000
committerAndrew Morton <akpm@linux-foundation.org>2023-12-29 11:58:29 -0800
commitb99b4e0d9d7f29b428bacd7a61188b2abf340c1e (patch)
tree60c002e9731a6a9a911f5783d7b70e7822ce5f59 /mm/page_io.c
parent96c7b0b42239e7b8987b2664b458dc74e825f760 (diff)
mm: pass a folio to __swap_writepage()
Both callers now have a folio, so pass that in instead of the page. Removes a few hidden calls to compound_head(). Link: https://lkml.kernel.org/r/20231213215842.671461-3-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/page_io.c')
-rw-r--r--mm/page_io.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/mm/page_io.c b/mm/page_io.c
index cb559ae324c6..e0d59f36b70b 100644
--- a/mm/page_io.c
+++ b/mm/page_io.c
@@ -201,7 +201,7 @@ int swap_writepage(struct page *page, struct writeback_control *wbc)
folio_end_writeback(folio);
return 0;
}
- __swap_writepage(&folio->page, wbc);
+ __swap_writepage(folio, wbc);
return 0;
}
@@ -368,22 +368,22 @@ static void swap_writepage_bdev_async(struct page *page,
submit_bio(bio);
}
-void __swap_writepage(struct page *page, struct writeback_control *wbc)
+void __swap_writepage(struct folio *folio, struct writeback_control *wbc)
{
- struct swap_info_struct *sis = page_swap_info(page);
+ struct swap_info_struct *sis = swp_swap_info(folio->swap);
- VM_BUG_ON_PAGE(!PageSwapCache(page), page);
+ VM_BUG_ON_FOLIO(!folio_test_swapcache(folio), folio);
/*
* ->flags can be updated non-atomicially (scan_swap_map_slots),
* but that will never affect SWP_FS_OPS, so the data_race
* is safe.
*/
if (data_race(sis->flags & SWP_FS_OPS))
- swap_writepage_fs(page, wbc);
+ swap_writepage_fs(&folio->page, wbc);
else if (sis->flags & SWP_SYNCHRONOUS_IO)
- swap_writepage_bdev_sync(page, wbc, sis);
+ swap_writepage_bdev_sync(&folio->page, wbc, sis);
else
- swap_writepage_bdev_async(page, wbc, sis);
+ swap_writepage_bdev_async(&folio->page, wbc, sis);
}
void swap_write_unplug(struct swap_iocb *sio)