bch_bio_alloc_pages(9)
π bch_bio_alloc_pages(9) π
okay so bestie, welcome to the Kernel API Manual β yes that's the manual name, we're being fancy today π β and today's main character is bch_bio_alloc_pages, a little function that hands out pages like they're concert tickets ποΈ
β¨ NAME β¨
bch_bio_alloc_pages β allocates a single page for each bvec in a bio. literally one page per bvec, no more no less, it's giving fairness π
πΈ SYNOPSIS πΈ
int bch_bio_alloc_pages (struct bio *bio , gfp_t gfp_mask );
π ARGUMENTS π
bioβ the bio you want pages for π¦ this is the one getting pamperedgfp_maskβ the flags for allocation, aka the vibe instructions for the allocator β¨
π DESCRIPTION π
So it allocates pages up to bio->bi_vcnt. that's the ceiling, bestie, it stops there, iconic behavior π«Ά
Returns 0 on success π and -ENOMEM on failure π. and hear me out β on failure, any allocated pages are freed. no leaks, no mess, she cleans up after herself, we love a responsible queen π
π SEE ALSO π
- Kernel file
./drivers/md/bcache/util.c bch_hprint(9)bch_next_delay(9)
ngl if you're poking around in bcache utility code, those two are your next stops, iykyk π₯
β and that's the whole page fr fr β brought to you by ./drivers/md/bcache, dated October 2026, and living its best life as bch_bio_alloc_pages(9). mwah, go read some more kernel docs, ily ππ
π¦ 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