Commit 2675251d authored by ZhangPeng's avatar ZhangPeng Committed by Andrew Morton

mm/page_io: use a folio in swap_writepage_bdev_async()

Saves one implicit call to compound_head().

Link: https://lkml.kernel.org/r/20230721034451.16412-9-zhangpeng362@huawei.comSigned-off-by: default avatarZhangPeng <zhangpeng362@huawei.com>
Reviewed-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: Nanyong Sun <sunnanyong@huawei.com>
Cc: Sidhartha Kumar <sidhartha.kumar@oracle.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent f54fcaab
...@@ -352,6 +352,7 @@ static void swap_writepage_bdev_async(struct page *page, ...@@ -352,6 +352,7 @@ static void swap_writepage_bdev_async(struct page *page,
struct writeback_control *wbc, struct swap_info_struct *sis) struct writeback_control *wbc, struct swap_info_struct *sis)
{ {
struct bio *bio; struct bio *bio;
struct folio *folio = page_folio(page);
bio = bio_alloc(sis->bdev, 1, bio = bio_alloc(sis->bdev, 1,
REQ_OP_WRITE | REQ_SWAP | wbc_to_write_flags(wbc), REQ_OP_WRITE | REQ_SWAP | wbc_to_write_flags(wbc),
...@@ -362,8 +363,8 @@ static void swap_writepage_bdev_async(struct page *page, ...@@ -362,8 +363,8 @@ static void swap_writepage_bdev_async(struct page *page,
bio_associate_blkg_from_page(bio, page); bio_associate_blkg_from_page(bio, page);
count_swpout_vm_event(page); count_swpout_vm_event(page);
set_page_writeback(page); folio_start_writeback(folio);
unlock_page(page); folio_unlock(folio);
submit_bio(bio); submit_bio(bio);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment