bio_reuse(9)
π bio_reuse π
okay so this is a page from the Kernel API Manual, and honestly it's a little cutie. let's get into it π«Ά
β¨ NAME β¨
bio_reuse β reuse a bio with the payload left intact π
πΈ SYNOPSIS πΈ
void bio_reuse (struct bio *bio , blk_opf_t opf );
π ARGUMENTS π
bioβ the bio you're reusing, bestie. that's the one.opfβ the operation and flags for the next I/O π₯
π¦ DESCRIPTION π¦
so basically this lets you reuse an existing bio for another operation while leaving all the already-set-up fields intact β and yes that includes the payload, the device, and the end_io handler. nothing gets disturbed. icon behavior, honestly π
the classic vibe check use case: the bio was first used to read data, and then that data gets written to another location without modification. no editing, no re-doing the setup, just slay and reuse β¨
β οΈ but listen β bio must not be in-flight, and it has to be owned by the caller. no cap, that part matters. and it can't be used for cloned bios. periodt π
π NOTE π
for now, it can't be used when the bio has integrity or blk-crypto contexts π
but the page literally says feel free to add that support when you need it, though β so like, main character energy if you do π
β SEE ALSO β
ya girl comes with friends π and there's a kernel file too: ./block/bio.c
bio_reset(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_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)
and that's the whole page, bestie π mwah π
sign-off time: this one lives in ./block, it's the October 2026 edition, and it goes by bio_reuse(9) β iykyk π
π
π¦ 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