bio_add_virt_nofail(9)
β¨ bio_add_virt_nofail π
okay so bestie, this is a page from the Kernel API Manual and it's about one very specific little function. she's small, she's focused, she does exactly one thing and she does NOT do merging. periodt. π
πΈ NAME πΈ
bio_add_virt_nofail β add data in the direct kernel mapping to a bio π¦
β SYNOPSIS β
void bio_add_virt_nofail (struct bio *bio , void *vaddr , unsigned len );
like, that's the whole signature. no cap, that's it. π
π ARGUMENTS π
bioβ the destination bio, aka where the data is going. she's the main character here fr. πvaddrβ the data to add. literally the payload, the whole point. β¨lenβ length of the data to add, and heads up bestie, it may cross pages. don't panic, that's allowed. π«Ά
π§ DESCRIPTION π§
So here's the vibe: you take the data sitting at vaddr and you add it to bio. simple. iconic. π
But lowkey there's a rule β the caller must have ensure a segment is available for the added data. that's on you, not on her. she's not out here checking, she's trusting you. π
And the big one: no merging into an existing segment will be performed. none. zero. not happening. if you were hoping she'd cozy up to a segment that's already there, nope, she's adding a fresh one and moving on. π
π₯ SEE ALSO π₯
Kernel file ./block/bio.c β plus a whole friend group of functions, all of them linked below, all of them real, all of them spelled exactly like this, don't come for me:
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_page(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)
ngl if your data is coming from somewhere that ISN'T the direct kernel mapping, this is not your girl. read the name. virt. direct kernel mapping. iykyk. π
okay that's the whole page!! mwah π this one lives in ./block and she's dated October 2026 β so like, future girlie energy fr fr. go forth and add your data, bestie, just make sure that segment is available first πβ¨π¦
π¦ 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