bio_add_folio(9)
π bio_add_folio(9) β the Kernel API Manual, bestie edition
okay so this is bio_add_folio(9) from the Kernel API Manual, and honestly? it's a little cutie. let's get into it π
β¨ NAME β¨
bio_add_folio β attempt to add part of a folio to a bio. that's it. that's the whole vibe. π
πΈ SYNOPSIS πΈ
bool bio_add_folio (struct bio *bio , struct folio *folio , size_t len ,
size_t off );
like, look at her. four args, returns a bool. main character energy fr fr. π
π¦ ARGUMENTS π¦
bioβ the BIO to add to. she's the one receiving. π«Άfolioβ the folio to add. the guest of honor β¨lenβ how many bytes from the folio to add. like, a slice. πoffβ first byte in this folio to add. yes, we're starting fromoff, not zero, don't come for me π
π DESCRIPTION π
so here's the tea β β filesystems that use folios can call this function instead of calling bio_add_page for every single page in the folio. the way that saves you a whole loop... iconic. ππ
here's the little plot twist though: if off is bigger than PAGE_SIZE, this function can create a bio_vec that starts in a page after the bv_page. yeah. it do be like that. π
π and this is the important bit, bestie β BIOs do not support folios that are 4GiB or larger. no cap. that's the limit. don't try it. β
π₯ RETURN π₯
whether the addition was successful. a simple bool, no drama, no hidden agenda. slay. β¨
π SEE ALSO π
kernel file ./block/bio.c plus the whole friend group:
bio_reset(9)bio_reuse(9)bio_chain(9)bio_chain_and_submit(9)bio_alloc_bioset(9)bio_kmalloc(9)bio_truncate(9)guard_bio_eod(9)bio_put(9)bio_alloc_clone(9)bio_init_clone(9)bio_full(9)__bio_add_page(9)bio_add_virt_nofail(9)bio_add_page(9)bio_add_vmalloc_chunk(9)bio_add_vmalloc(9)bio_iov_iter_get_pages(9)bio_iov_iter_bounce(9)bio_iov_iter_unbounce(9)bio_await(9)submit_bio_wait(9)bdev_rw_virt(9)bio_copy_data(9)bio_endio(9)bio_split(9)bio_trim(9)bioset_init(9)
iykyk π§π
and that's the whole page!! this one lives under ./block and it's dated October 2026, page bio_add_folio(9) β go off, block layer. πΈπ¦β
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms