bio_add_vmalloc_chunk(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… bio_add_vmalloc_chunk(9) β€” a Kernel API Manual moment

okay bestie, so this one lives in the Kernel API Manual and it's giving "small helper, big responsibility" energy. Let's get into it ✨


πŸŽ€ NAME πŸŽ€

bio_add_vmalloc_chunk β€” literally just adds a vmalloc chunk to a bio. that's it. that's the whole job. πŸ’–


✨ SYNOPSIS ✨

unsigned int bio_add_vmalloc_chunk (struct bio *bio , void *vaddr ,
       unsigned len );

like, three args, one unsigned int back. no cap, she's lowkey elegant πŸ¦‹


🌸 ARGUMENTS 🌸

  • bio β€” the destination bio. the ✨main character✨ of this whole operation, the one receiving the data 🫢
  • vaddr β€” the vmalloc address you're adding. yes, this specific one, pls don't mix it up πŸ™ˆ
  • len β€” total length in bytes of the data you want to add. the full wishlist, basically πŸ’…

πŸ’œ DESCRIPTION πŸ’œ

so what she does is: add the data starting at vaddr to bio, and then tell you how many bytes actually made it in. πŸ”₯

heads up though β€” that number might be less than what you originally asked for. not a bug, just how she is. and if nothing at all could be added to bio, she returns 0. periodt πŸ’€

she also calls flush_kernel_vmap_range for the range that got added β€” icon behavior, honestly, taking care of that for you 🧚

⚠️ but for reads? you're not off the hook, bestie. the caller still needs to manually call invalidate_kernel_vmap_range in the completion handler. don't forget, i'm begging 😭

🌈 SEE ALSO 🌈

fr fr, go read these too, they're all in the kernel file ./block/bio.c:


and that's the whole page, bestie πŸ’– this lil number came out of the ./block directory, dated October 2026, and she goes by bio_add_vmalloc_chunk(9) β€” go forth and slay your bio builds βœ¨πŸ‘‘

πŸ“¦ where this page comes from