Commit 6a8c0687 authored by ZhangPeng's avatar ZhangPeng Committed by Andrew Morton

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.comSigned-off-by: default avatarZhangPeng <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: default avatarAndrew Morton <akpm@linux-foundation.org>
parent bc74b53f
...@@ -403,17 +403,17 @@ static void sio_read_complete(struct kiocb *iocb, long ret) ...@@ -403,17 +403,17 @@ static void sio_read_complete(struct kiocb *iocb, long ret)
if (ret == sio->len) { if (ret == sio->len) {
for (p = 0; p < sio->pages; p++) { 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); folio_mark_uptodate(folio);
unlock_page(page); folio_unlock(folio);
} }
count_vm_events(PSWPIN, sio->pages); count_vm_events(PSWPIN, sio->pages);
} else { } else {
for (p = 0; p < sio->pages; p++) { 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"); pr_alert_ratelimited("Read-error on swap-device\n");
} }
......
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