blk_stat_alloc_callback(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 the data field of the struct 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 πŸ¦‹

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