On Wed, Jun 05, 2024 at 10:22:11PM +0100, Matthew Wilcox wrote: > Why can't we have ... > > bio_release_folio(bio, fi.folio, nr_pages); > > which is implemented as: > > static inline void bio_release_page(struct bio *bio, struct folio *folio, unsigned long nr_pages) > { > if (bio_flagged(bio, BIO_PAGE_PINNED)) > gup_put_folio(folio, nr_pages, FOLL_PIN); > } > > Sure, we'd need to make gup_put_folio() unstatic, but this seems far > more sensible. Yes. Although maybe a unpin_user_folio wrapper that hides the FOLL_PIN which we're trying to keep private would be the slightly nicer variant.