On Mon, Jul 17, 2023 at 09:25:57PM +0800, Peng Zhang wrote:
+++ b/mm/page_io.cShould we have a bio_first_folio_all()? It wouldn't save any calls to
@@ -58,18 +58,18 @@ static void end_swap_bio_write(struct bio *bio)
static void __end_swap_bio_read(struct bio *bio)
{
- struct page *page = bio_first_page_all(bio);
+ struct folio *folio = page_folio(bio_first_page_all(bio));
compound_head(), but it's slightly easier to use.
if (bio->bi_status) {I appreciate this is a 1:1 conversion, but maybe we could think about
- SetPageError(page);
- ClearPageUptodate(page);
+ folio_set_error(folio);
this a bit. Is there anybody who checks the
PageError()/folio_test_error() for this page/folio?
+ folio_clear_uptodate(folio);Similarly ... surely the folio is already !uptodate, so we don't need to
clear the flag?