summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhangPeng <zhangpeng362@huawei.com>2023-07-21 05:44:47 +0200
committerAndrew Morton <akpm@linux-foundation.org>2023-08-18 19:12:45 +0200
commit6a8c068774ad7634b43bebd97182141765398835 (patch)
treef585597a4bee985a78a8187d2e39c83a0495d1f6
parentmm/page_io: use a folio in __end_swap_bio_read() (diff)
downloadlinux-6a8c068774ad7634b43bebd97182141765398835.tar.xz
linux-6a8c068774ad7634b43bebd97182141765398835.zip
mm/page_io: use a folio in sio_read_complete()
Saves one implicit call to compound_head(). Link: https://lkml.kernel.org/r/20230721034451.16412-7-zhangpeng362@huawei.com Signed-off-by: ZhangPeng <zhangpeng362@huawei.com> Cc: Christoph Hellwig <hch@infradead.org> Cc: Kefeng Wang <wangkefeng.wang@huawei.com> Cc: Matthew Wilcox (Oracle) <willy@infradead.org> Cc: Nanyong Sun <sunnanyong@huawei.com> Cc: Sidhartha Kumar <sidhartha.kumar@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-rw-r--r--mm/page_io.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/mm/page_io.c b/mm/page_io.c
index 6faaaa9a6c3b..979d9ce7d9cd 100644
--- a/mm/page_io.c
+++ b/mm/page_io.c
@@ -403,17 +403,17 @@ static void sio_read_complete(struct kiocb *iocb, long ret)
if (ret == sio->len) {
for (p = 0; p < sio->pages; p++) {
- struct page *page = sio->bvec[p].bv_page;
+ struct folio *folio = page_folio(sio->bvec[p].bv_page);
- SetPageUptodate(page);
- unlock_page(page);
+ folio_mark_uptodate(folio);
+ folio_unlock(folio);
}
count_vm_events(PSWPIN, sio->pages);
} else {
for (p = 0; p < sio->pages; p++) {
- struct page *page = sio->bvec[p].bv_page;
+ struct folio *folio = page_folio(sio->bvec[p].bv_page);
- unlock_page(page);
+ folio_unlock(folio);
}
pr_alert_ratelimited("Read-error on swap-device\n");
}