blk_stat_alloc_callback(9)
π blk_stat_alloc_callback(9) β a whole little page from the Kernel API Manual, bestie
okay so picture this: you're deep in the kernel, you want block statistics, and you need a callback to hold all your stats buckets. that's this function. her whole job is allocating the block statistics callback. no cap. π
β¨ SYNOPSIS β¨
struct blk_stat_callback * blk_stat_alloc_callback (void
(*timer_fn)(struct blk_stat_callback *) , int (*bucket_fn)(const struct
request *) , unsigned int buckets , void *data );
like, look at her. four arguments, one glorious pointer back. π₯
π«Ά ARGUMENTS π«Ά
timer_fnβ the timer callback function. yes, the same struct's timer callback. she's the one who gets called on the timer vibes.bucket_fnβ the bucket callback function. she decides the bucket situation.bucketsβ number of statistics buckets. it's unsigned int, so pls don't come at her with a negative number, that's not the vibe. πΈdataβ the value that gets dropped into thedatafield of thestruct blk_stat_callback. a little gift. a little payload. iconic. π
π DESCRIPTION π
not gonna lie, the description is short and she is thriving in her minimalism era:
See struct blk_stat_callback for details on the callback functions.
that's it. that's the description. literally go read the struct if you want the tea on how the callback functions actually work. iykyk. β
π RETURN π
you get a struct blk_stat_callback on success π
β or NULL on ENOMEM, which is giving "the memory said no ma'am." π so like, always check, bestie. always check.
π¦ SEE ALSO π¦
- Kernel file
./block/blk-stat.hβ yes the actual file, go look at it π§ struct blk_stat_callback(9)blk_stat_add_callback(9)blk_stat_remove_callback(9)blk_stat_free_callback(9)blk_stat_is_active(9)blk_stat_activate_nsecs(9)blk_stat_activate_msecs(9)
like the whole blk-stat friend group showed up to the function. we love a supportive squad. π
mwah π that's the page!! sourced from ./block (that's the section, queen), and it's dated October 2026, and the whole thing is filed under blk_stat_alloc_callback(9). go forth and allocate responsibly, bestie. πΈβ¨
π¦ 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