bio_add_folio(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… bio_add_folio(9) β€” the Kernel API Manual, bestie edition

okay so this is bio_add_folio(9) from the Kernel API Manual, and honestly? it's a little cutie. let's get into it πŸŽ€


✨ NAME ✨

bio_add_folio β€” attempt to add part of a folio to a bio. that's it. that's the whole vibe. πŸ’–


🌸 SYNOPSIS 🌸

bool bio_add_folio (struct bio *bio , struct folio *folio , size_t len ,
size_t off );

like, look at her. four args, returns a bool. main character energy fr fr. πŸ‘‘


πŸ¦‹ ARGUMENTS πŸ¦‹

  • bio β€” the BIO to add to. she's the one receiving. 🫢
  • folio β€” the folio to add. the guest of honor ✨
  • len β€” how many bytes from the folio to add. like, a slice. πŸ“
  • off β€” first byte in this folio to add. yes, we're starting from off, not zero, don't come for me πŸ™ˆ

πŸ’œ DESCRIPTION πŸ’œ

so here's the tea β˜• β€” filesystems that use folios can call this function instead of calling bio_add_page for every single page in the folio. the way that saves you a whole loop... iconic. πŸ˜­πŸ’…

here's the little plot twist though: if off is bigger than PAGE_SIZE, this function can create a bio_vec that starts in a page after the bv_page. yeah. it do be like that. πŸ™ˆ

πŸ’€ and this is the important bit, bestie β€” BIOs do not support folios that are 4GiB or larger. no cap. that's the limit. don't try it. ⭐

πŸ”₯ RETURN πŸ”₯

whether the addition was successful. a simple bool, no drama, no hidden agenda. slay. ✨


🌈 SEE ALSO 🌈

kernel file ./block/bio.c plus the whole friend group:

iykyk πŸ§šπŸ’œ


and that's the whole page!! this one lives under ./block and it's dated October 2026, page bio_add_folio(9) β€” go off, block layer. πŸŒΈπŸ¦‹β­

πŸ“¦ where this page comes from