Skip to content

Commit 6a8c068

Browse files
ZhangPengakpm00
authored andcommitted
mm/page_io: use a folio in sio_read_complete()
Saves one implicit call to compound_head(). Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: ZhangPeng <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Kefeng Wang <[email protected]> Cc: Matthew Wilcox (Oracle) <[email protected]> Cc: Nanyong Sun <[email protected]> Cc: Sidhartha Kumar <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent bc74b53 commit 6a8c068

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

mm/page_io.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -403,17 +403,17 @@ static void sio_read_complete(struct kiocb *iocb, long ret)
403403

404404
if (ret == sio->len) {
405405
for (p = 0; p < sio->pages; p++) {
406-
struct page *page = sio->bvec[p].bv_page;
406+
struct folio *folio = page_folio(sio->bvec[p].bv_page);
407407

408-
SetPageUptodate(page);
409-
unlock_page(page);
408+
folio_mark_uptodate(folio);
409+
folio_unlock(folio);
410410
}
411411
count_vm_events(PSWPIN, sio->pages);
412412
} else {
413413
for (p = 0; p < sio->pages; p++) {
414-
struct page *page = sio->bvec[p].bv_page;
414+
struct folio *folio = page_folio(sio->bvec[p].bv_page);
415415

416-
unlock_page(page);
416+
folio_unlock(folio);
417417
}
418418
pr_alert_ratelimited("Read-error on swap-device\n");
419419
}

0 commit comments

Comments
 (0)