bio_copy_kern(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– bio_copy_kern β€” like, the whole vibe πŸ’–

okay so bestie, welcome to bio_copy_kern(9) from the Kernel API Manual β€” section 9, kernel-space, extremely legit territory. sit down, grab a lil snack πŸ“, and let's get into it.


✨ NAME ✨

bio_copy_kern β€” the function that copies a kernel address right on into a bio 🫢


✨ SYNOPSIS ✨

struct bio * bio_copy_kern (struct request *rq , void *data , unsigned
int len , gfp_t gfp_mask );

that's the whole signature, no cap. it hands you back a struct bio * 🌸


✨ ARGUMENTS ✨

  • rq β€” the request you're filling up. it's giving "this is the thing we're working with" πŸ’…
  • data β€” a pointer to the buffer you wanna copy. literally just point at it πŸŽ€
  • len β€” the length, in bytes. numbers, bestie, we love a unit πŸ”₯
  • gfp_mask β€” the allocation flags, and heads up: these cover both the bio allocation and the page allocation. two for one ✨

✨ DESCRIPTION ✨

so what it actually does: it copies the kernel address into a bio that's suitable for io to a block device. that's the whole job, and it ate πŸ‘‘

and if something goes sideways? it returns an error pointer. so like… check your return value, babes, it's not always gonna be a happy lil bio 😭

fr fr, error pointer means error. don't just start dereferencing and hope for the best πŸ™ˆ

✨ SEE ALSO ✨

sibling functions, the whole friend group 🧚:

and they all live together in the kernel file ./block/blk-map.c β€” iconic address ngl πŸ’œ


🌈 bye bestie 🌈

this lil page came out of the ./block directory, dated October 2026, in the Kernel API Manual, section 9, under the name bio_copy_kern(9). mwah, go read some block layer code, i'm obsessed with you πŸ’–πŸ’…βœ¨

πŸ“¦ where this page comes from