On Wed, Jun 05, 2024 at 07:45:23PM +0100, Matthew Wilcox wrote: > > if (bio->bi_vcnt > 0 && > > bvec_try_merge_page(&bio->bi_io_vec[bio->bi_vcnt - 1], > > - page, len, offset, &same_page)) { > > + &folio->page, len, offset, &same_page)) { > > Let's make that folio_page(folio, 0) Or just pass a folio to bvec_try_merge_page (and rename it) if we want to go all the way, but given that that will go down quite a bit into xen and zone device code maybe that's not worth it for now as we should eventually just convert it to a plain phys_addr_t anyway. > > struct request_queue *q = bdev_get_queue(bio->bi_bdev); > > bool same_page = false; > > > > - if (bio_add_hw_page(q, bio, page, len, offset, > > + if (bio_add_hw_page(q, bio, &folio->page, len, offset, > > Likewise. OTOH replacing / augmenting bio_add_hw_page with a bio_add_hw_folio should be worthwhile, so I'd love to see that as a prep patch.