bvec_folio(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… bvec_folio β€” like, the first folio energy

okay so bestie, this is a page from the Kernel API Manual (section 9, the kernel-API girlies) and it's all about bvec_folio. yes it's a real function, yes it's iconic, no you probably shouldn't call it. let's get into it ✨


✨ SYNOPSIS ✨

struct folio * bvec_folio (const struct bio_vec *bv );

like that's the whole thing. one function, one pointer in, one folio pointer out. she's simple, she's elegant, she's got main character energy πŸŽ€


🌸 ARGUMENTS 🌸

  • bv β€” the bvec you wanna poke at. that's it, that's the argument. it's the bvec to access, no cap 🫢

πŸ’– DESCRIPTION πŸ’–

so here's the tea, and it's kind of a big deal πŸ”₯

A bvec can literally contain non-folio memory, meaning the thing you're looking at might not even be a folio like that. so this function should only be called by the creator of the bvec β€” the person who actually built it and knows what's in there. drivers? drivers have no business looking at the owner of the memory. none. zero. don't do it πŸ™ˆ

and lowkey it might not even be the right interface for the caller to use, because a bvec can span multiple folios β€” the way that one bvec can be holding like five folios at once and you're over here asking for "the first one" like that's gonna solve everything 😭

so honestly? you may be better off using something like bio_for_each_folio_all, which iterates over all the folios. yes, all of them. every single one. she's thorough, she's giving complete coverage, she ate πŸ’…

fr fr: if you're a driver and you're reading this section thinking "but I just need one folio"β€” no. the manpage said what it said. bio_for_each_folio_all is right there. use her. 🧚

πŸ¦‹ SEE ALSO πŸ¦‹

the whole bvec friend group, honestly. they all show up together, they all support each other, we love a cohesive cast 🌈


πŸ‘‘ sign-off πŸ‘‘

this absolute gem lives in ./include/linux and the page is dated October 2026 β€” so yeah, future girlie behavior, we love to see it. that's the whole manual page bestie, go forth and please not call bvec_folio from a driver, I'm begging πŸ«ΆπŸ’–β­

πŸ“¦ where this page comes from