bio_copy_kern(9)
π 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 π§:
bio_copy_from_iter(9)bio_copy_to_iter(9)bio_uncopy_user(9)blk_rq_map_user_iov(9)blk_rq_unmap_user(9)blk_rq_map_kern(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms