bio_init_clone(9)
π bio_init_clone(9) β like, the Kernel API Manual page, bestie
okay so we're in the Kernel API Manual today and the function we're stanning is bio_init_clone. yes, it's a real one, and yes, it's giving "I clone bios and I share biovecs" main character energy. let me walk you through it π«Ά
β¨ NAME β¨
bio_init_clone β clones a bio, and the clone shares the original bio's biovec. that's the whole vibe, periodt.
πΈ SYNOPSIS πΈ
int bio_init_clone (struct block_device *bdev , struct bio *bio , struct
bio *bio_src , gfp_t gfp );
π ARGUMENTS π
bdevβ theblock_deviceyou're cloning onto. where it's going πbioβ the bio you're cloning into. the destination, the new home, the fresh fit β¨bio_srcβ the bio you're cloning from. the original, the blueprint, the source material πgfpβ the allocation priority. how hard you're allowed to try to get memory π§
π¦ DESCRIPTION π¦
So what it actually does: it initializes a new bio in memory that you, the caller, provide β and that new bio is a clone of bio_src. no cap, you're handing it the space.
And the reuse rules? The same bio_vecs reuse and bio lifetime rules as bio_alloc_clone apply. that's it, that's the tea β β different function, same rules, iykyk.
π₯ SEE ALSO π₯
the whole friend group shows up here, and honestly? iconic. all of these are from the kernel file ./block/bio.c:
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_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)
like, the entire roster. go read them, I'll wait π
and that's the page!! this lil beauty lives in the source ./block, and it's dated October 2026, and it's filed under bio_init_clone(9) β so if you forget where you found it, it's literally right there in the footer. mwah π bye bestie, go clone some bios responsibly π
π¦ 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