bio_add_virt_nofail(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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