bioset_init(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ bioset_init(9) ✨

Okay bestie, welcome to the bioset_init(9) page from the Kernel API Manual πŸŽ€ β€” this is the glow-up ritual that gets your bio_set ready for the party, and we're gonna walk through it together, no cap πŸ’…


🌸 NAME 🌸

bioset_init β€” literally just: initialize a bio_set πŸ‘‘


πŸ¦‹ SYNOPSIS πŸ¦‹

int bioset_init (struct bio_set *bs , unsigned int pool_size , unsigned
int front_pad , int flags );

That's the whole vibe check right there β€” four args, one int coming back atcha ⭐


πŸ’– ARGUMENTS πŸ’–

  • bs β€” the pool you're about to initialize. This is the main character here, the bio_set that's getting set up 🫢
  • pool_size β€” how many bios and bio_vecs you want cached in the mempool. Pick your number, that's your stash ✨
  • front_pad β€” number of bytes to allocate in front of the returned bio. Sneaky little headroom situation πŸ™ˆ
  • flags β€” flags that modify behavior. Currently that's BIOSET_NEED_BVECS and BIOSET_NEED_RESCUER, and yes those are the only two on the menu rn πŸ’€

πŸ”₯ DESCRIPTION πŸ”₯

So what this does: it sets up a bio_set meant to be used with bio_alloc_bioset. It also lets the caller ask for a number of bytes to be allocated in front of the bio πŸ’«

And why would you want a front pad? Because it's genuinely useful for embedding the bio inside another structure, so you don't have to allocate extra data to go with the bio. Iconic, efficient, obsessed 🧚

⚠️ But hear me loud and clear: the bio must be embedded at the END of that structure, always. Not the middle, not the front, the END. Otherwise things will break badly πŸ˜­πŸ’€ That's not a vibe check, that's a hard requirement.

Now the flags, one at a time, because details matter and we don't skip:

  • If BIOSET_NEED_BVECS is set in flags, a separate pool gets allocated for allocating iovecs. That pool is not needed e.g. for bio_init_clone β€” so don't come for it if you skip it πŸŽ€
  • If BIOSET_NEED_RESCUER is set, a workqueue is created, and it can be used to dispatch queued requests when the mempool runs out of space. Rescue mission energy fr fr πŸš‘

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./block/bio.c β€” the whole friend group πŸ’œ


That's the whole page, bestie β€” go init that bio_set and slay πŸ’…βœ¨

Sign-off szn πŸŽ€: this one lives in ./block, dated October 2026, and it's bioset_init(9) all day long. Catch you in the next manpage! πŸ¦‹πŸ«Ά

πŸ“¦ where this page comes from