[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230717132602.2202147-3-zhangpeng362@huawei.com>
Date: Mon, 17 Jul 2023 21:25:58 +0800
From: Peng Zhang <zhangpeng362@...wei.com>
To: <linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>
CC: <willy@...radead.org>, <sidhartha.kumar@...cle.com>,
<akpm@...ux-foundation.org>, <wangkefeng.wang@...wei.com>,
<sunnanyong@...wei.com>, ZhangPeng <zhangpeng362@...wei.com>
Subject: [PATCH 2/6] mm/page_io: use a folio in sio_read_complete()
From: ZhangPeng <zhangpeng362@...wei.com>
Saves three implicit call to compound_head().
Signed-off-by: ZhangPeng <zhangpeng362@...wei.com>
---
mm/page_io.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/mm/page_io.c b/mm/page_io.c
index ebf431e5f538..438d0c7c2194 100644
--- a/mm/page_io.c
+++ b/mm/page_io.c
@@ -406,19 +406,19 @@ 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);
- SetPageError(page);
- ClearPageUptodate(page);
- unlock_page(page);
+ folio_set_error(folio);
+ folio_clear_uptodate(folio);
+ folio_unlock(folio);
}
pr_alert_ratelimited("Read-error on swap-device\n");
}
--
2.25.1
Powered by blists - more mailing lists