Skip to content

Commit a3ed1e9

Browse files
ZhangPengakpm00
authored andcommitted
mm/page_io: use a folio in __end_swap_bio_write()
Saves two implicit call to compound_head(). Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: ZhangPeng <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Kefeng Wang <[email protected]> Cc: Matthew Wilcox (Oracle) <[email protected]> Cc: Nanyong Sun <[email protected]> Cc: Sidhartha Kumar <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 6d2790d commit a3ed1e9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

mm/page_io.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
static void __end_swap_bio_write(struct bio *bio)
3131
{
32-
struct page *page = bio_first_page_all(bio);
32+
struct folio *folio = bio_first_folio_all(bio);
3333

3434
if (bio->bi_status) {
3535
/*
@@ -40,13 +40,13 @@ static void __end_swap_bio_write(struct bio *bio)
4040
*
4141
* Also clear PG_reclaim to avoid folio_rotate_reclaimable()
4242
*/
43-
set_page_dirty(page);
43+
folio_mark_dirty(folio);
4444
pr_alert_ratelimited("Write-error on swap-device (%u:%u:%llu)\n",
4545
MAJOR(bio_dev(bio)), MINOR(bio_dev(bio)),
4646
(unsigned long long)bio->bi_iter.bi_sector);
47-
ClearPageReclaim(page);
47+
folio_clear_reclaim(folio);
4848
}
49-
end_page_writeback(page);
49+
folio_end_writeback(folio);
5050
}
5151

5252
static void end_swap_bio_write(struct bio *bio)

0 commit comments

Comments
 (0)