Skip to content

Commit f54fcaa

Browse files
ZhangPengakpm00
authored andcommitted
mm/page_io: use a folio in swap_writepage_bdev_sync()
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 6a8c068 commit f54fcaa

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
@@ -331,6 +331,7 @@ static void swap_writepage_bdev_sync(struct page *page,
331331
{
332332
struct bio_vec bv;
333333
struct bio bio;
334+
struct folio *folio = page_folio(page);
334335

335336
bio_init(&bio, sis->bdev, &bv, 1,
336337
REQ_OP_WRITE | REQ_SWAP | wbc_to_write_flags(wbc));
@@ -340,8 +341,8 @@ static void swap_writepage_bdev_sync(struct page *page,
340341
bio_associate_blkg_from_page(&bio, page);
341342
count_swpout_vm_event(page);
342343

343-
set_page_writeback(page);
344-
unlock_page(page);
344+
folio_start_writeback(folio);
345+
folio_unlock(folio);
345346

346347
submit_bio_wait(&bio);
347348
__end_swap_bio_write(&bio);

0 commit comments

Comments
 (0)