Skip to content

Commit 2675251

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

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mm/page_io.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,7 @@ static void swap_writepage_bdev_async(struct page *page,
352352
struct writeback_control *wbc, struct swap_info_struct *sis)
353353
{
354354
struct bio *bio;
355+
struct folio *folio = page_folio(page);
355356

356357
bio = bio_alloc(sis->bdev, 1,
357358
REQ_OP_WRITE | REQ_SWAP | wbc_to_write_flags(wbc),
@@ -362,8 +363,8 @@ static void swap_writepage_bdev_async(struct page *page,
362363

363364
bio_associate_blkg_from_page(bio, page);
364365
count_swpout_vm_event(page);
365-
set_page_writeback(page);
366-
unlock_page(page);
366+
folio_start_writeback(folio);
367+
folio_unlock(folio);
367368
submit_bio(bio);
368369
}
369370

0 commit comments

Comments
 (0)