guard_bio_eod(9)
π guard_bio_eod(9) π
okay so welcome to the Kernel API Manual, bestie β this little page is guard_bio_eod(9) and it's genuinely one of those tiny functions that saves your whole entire life π«Ά
β¨ NAME β¨
guard_bio_eod β truncate a BIO to fit the block device π
πΈ SYNOPSIS πΈ
void guard_bio_eod (struct bio *bio );
that's it. that's the whole signature. short king behavior honestly π
π¦ ARGUMENTS π¦
bioβ the bio to truncate. yes it's just the one. she's low maintenance π
β DESCRIPTION β
so the whole point, and I need you to hear me on this: this lets us do IO even on the odd last sectors of a device β even when the block size is some multiple of the physical sector size. like, the math doesn't work out and we're still showing up to the function anyway π
we'll just truncate the bio down to the size of the device, and clear the end of the buffer head manually. no cap, that's the move β¨
and before you panic β truly out-of-range accesses will turn into actual I/O errors. this only handles the "we need to be able to do I/O at the final sector" case. that's the vibe check right there, don't ask her to do more π
π₯ SEE ALSO π₯
kernel file ./block/bio.c and the whole friend group, fr fr:
bio_reset(9)bio_reuse(9)bio_chain(9)bio_chain_and_submit(9)bio_alloc_bioset(9)bio_kmalloc(9)bio_truncate(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)
like look at that lineup. main character energy all around π
π§ and that's the page, bestie! this one came straight out of ./block, dated October 2026 β mwah, slay, periodt ππβ¨
π¦ 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