summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorZhangPeng <zhangpeng362@huawei.com>2023-07-21 11:44:49 +0800
committerAndrew Morton <akpm@linux-foundation.org>2023-08-18 10:12:46 -0700
commit2675251d5037c308a03f8ad1545b4169522cb950 (patch)
treec4b517370b51def6a4c76a57f51218f5e7bbb7b7 /mm
parentf54fcaabd34b98921ec12501d0507e1fa1ae831b (diff)
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.com Signed-off-by: ZhangPeng <zhangpeng362@huawei.com> Reviewed-by: Matthew 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: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/page_io.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mm/page_io.c b/mm/page_io.c
index fc6e1a41744c..886addfabc70 100644
--- a/mm/page_io.c
+++ b/mm/page_io.c
@@ -352,6 +352,7 @@ static void swap_writepage_bdev_async(struct page *page,
struct writeback_control *wbc, struct swap_info_struct *sis)
{
struct bio *bio;
+ struct folio *folio = page_folio(page);
bio = bio_alloc(sis->bdev, 1,
REQ_OP_WRITE | REQ_SWAP | wbc_to_write_flags(wbc),
@@ -362,8 +363,8 @@ static void swap_writepage_bdev_async(struct page *page,
bio_associate_blkg_from_page(bio, page);
count_swpout_vm_event(page);
- set_page_writeback(page);
- unlock_page(page);
+ folio_start_writeback(folio);
+ folio_unlock(folio);
submit_bio(bio);
}