blkg_conf_prep(9)
β¨ NAME β¨
Okay so bestie, this is blkg_conf_prep(9) from the Kernel API Manual β and it's literally the function that parses and prepares for a per-blkg config update. No cap, it's giving main character energy for cgroup config vibes. π
πΈ SYNOPSIS πΈ
int blkg_conf_prep (struct blkcg *blkcg , const struct blkcg_policy *pol
, struct blkg_conf_ctx *ctx );
π ARGUMENTS π
blkcgβ the target block cgroup, aka the cgroup you're trying to update. Slay.polβ the target policy. The rules that govern how the cgroup behaves. Iconic.ctxβ ablkg_conf_ctxthat's already been initialized withblkg_conf_init. Don't skip this step, bestie.
π¦ DESCRIPTION π¦
So here's the tea: blkg_conf_prep parses a per-blkg config update from ctx->input and sets up ctx accordingly. It's literally reading your config string and getting everything ready for the actual update. π₯
On success β and only on success β here's what you get:
ctx->bodypoints to the part ofctx->inputthat comes after theMAJ:MINpart. Like, it skips the device identifier and hands you the rest.ctx->bdevpoints to the target block device. That's your block device, bestie.ctx->blkgpoints to theblkgbeing configured. The actual cgroup block thing being updated.
β οΈ Important caveat:blkg_conf_open_bdevmust be called onctxbeforehand. Do not skip this. It's not a vibe to skip it.
β οΈ Also important: On success, this function returns with the queue lock held, and it must be followed by blkg_conf_close_bdev. That's the cleanup step. Don't leave the lock hanging, that's not the move. π
π SEE ALSO π
Kernel file ./block/blk-cgroup.c β and then it's a whole friend group of related functions: blkcg_css(9), blkg_free(9), bio_blkcg_css(9), blkcg_parent(9), blkg_alloc(9), blkg_lookup_create(9), blkcg_print_blkgs(9), __blkg_prfill_u64(9), blkg_conf_init(9), blkg_conf_open_bdev(9), blkg_conf_unprep(9), blkg_conf_close_bdev(9), blkcg_destroy_blkgs(9), blkcg_pin_online(9), blkcg_unpin_online(9), blkcg_css_offline(9), blkcg_activate_policy(9), blkcg_deactivate_policy(9), blkcg_policy_register(9), blkcg_policy_unregister(9), blkcg_maybe_throttle_current(9), blkcg_schedule_throttle(9), blkcg_add_delay(9), blkg_tryget_closest(9), bio_associate_blkg_from_css(9), bio_associate_blkg(9), bio_clone_blkg_association(9). That's the whole squad. π
π Written by your fave Unix bestie | From the ./block directory, source version October 2026 | Page: blkg_conf_prep(9) | Now go config those blkgs, queen! πβ¨
π¦ 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