guard_bio_eod(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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:

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