bio_add_page(9)
π« bio_add_page(9) π«
okay so this is a page straight out of the Kernel API Manual, and it's literally all about bio_add_page β the little function that tries to shove page(s) into a bio π«Ά
β¨ NAME β¨
bio_add_page β attempt to add page(s) to bio
π SYNOPSIS π
int bio_add_page (struct bio *bio , struct page *page , unsigned int len
, unsigned int offset );
πΈ ARGUMENTS πΈ
bioβ the destination bio, aka where the pages are headed πpageβ the start page you're addinglenβ the vec entry length, and ngl it may cross pagesoffsetβ the vec entry offset relative to the page, which, bestie, may also cross pages
π¦ DESCRIPTION π¦
So the whole vibe here is: attempt to add page(s) to the bio_vec maplist β¨
And it will only fail in two situations, no cap:
bio->bi_vcnt == bio->bi_max_vecs- it's a cloned bio
like... that's it. that's the whole failure criteria. if neither of those is true, it slays π
π₯ 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_folio(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)
okay that's the whole page!! π this came from the ./block corner of the kernel and it's dated October 2026 β mwah, iconic, no notes πβ¨π·
π¦ 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