bio_truncate(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ bio_truncate β€” the Kernel API Manual (section 9) ✨

okay bestie, welcome to bio_truncate(9) β€” yes, section 9, the kernel-functions chapter, we love a niche queen πŸ’…. This is the one that truncates a bio to a small size. Let's get into it, no cap.


πŸŽ€ SYNOPSIS πŸŽ€

void bio_truncate (struct bio *bio , unsigned new_size );

literal function signature, copied exactly, do not come for me πŸ™ˆ


πŸ¦‹ ARGUMENTS πŸ¦‹

  • bio β€” the bio that's getting truncated. it's the main character here, we're literally shrinking it πŸ‘‘
  • new_size β€” the new size you want the bio truncated to. yes it's just called new_size, she's straightforward and we respect that 🫢

🌸 DESCRIPTION 🌸

so the vibe is: truncate the bio down to a new size of new_size. that's the whole job. slay πŸ’…

but wait β€” there's a plot twist ✨ if bio_op(bio) is REQ_OP_READ, then you zero out the truncated part. like, the bits you chopped off get filled with zeros. don't skip that step bestie, it's giving "important" 🚨

⚠️ fr fr: this function should only be used for handling corner cases, such as bio eod. it is not your everyday go-to. corner cases only, iykyk 😭

πŸ’œ SEE ALSO πŸ’œ

the whole friend group, all of them, in Kernel file ./block/bio.c:


and that's the whole page, bestie!! πŸŽ€πŸ’–βœ¨

this lil beauty lives in ./block and the version/date stamp on it is October 2026 β€” so mark your calendar, she's from the future and she's iconic for it πŸ”₯πŸ‘‘. bye bestie, go truncate responsibly πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from