check_code(9)
π check_code(9) β yes bestie, it's a whole kernel man page
okay so this is check_code from section 9 of the manual (kernel API vibes only, no cap), and she's a little validation bouncer. Let's get into it π«Ά
β¨ NAME β¨
check_code β literally just checks the result of a state validation. that's the whole gig. π
π¦ SYNOPSIS π¦
bool check_code (bool valid , const struct admin_state_code *code ,
const char *what , struct vdo_completion *waiter );
π ARGUMENTS π
validβTrueif the code is of an appropriate type. this is the vibe check itself, bestie.codeβ the code which failed to be of the correct type. yeah. she failed. πwhatβ what the code failed to be, for logging. basically the "you were supposed to be XYZ" note so the logs know what to cry about.waiterβ the completion to notify of the error; may beNULL. so like, optional plus-one. π
πΈ DESCRIPTION πΈ
the way that this function is so simple:
if the result failed β log an invalid state error, and then, if there is a waiter, notify it. that's it. no extra lore. they just want the error logged and the waiter told. πβ¨
ngl,waiterbeing allowed to beNULLis the whole plot twist here. no waiter? no notification. just a sad little log entry and we move on. π
β RETURN β
the result of the check. she returns the check's result, periodt. π
π SEE ALSO π
the kernel file ./drivers/md/dm-vdo/admin-state.c and this absolutely iconic friend group:
get_next_state(9)vdo_finish_operation(9)begin_operation(9)start_operation(9)assert_vdo_drain_operation(9)vdo_start_draining(9)vdo_finish_draining(9)vdo_finish_draining_with_result(9)vdo_assert_load_operation(9)vdo_start_loading(9)vdo_finish_loading(9)vdo_finish_loading_with_result(9)assert_vdo_resume_operation(9)vdo_start_resuming(9)vdo_finish_resuming(9)vdo_finish_resuming_with_result(9)vdo_resume_if_quiescent(9)vdo_start_operation(9)vdo_start_operation_with_waiter(9)
that's the whole page, bestie β go check some codes, stay valid π
sign-off time π this little masterpiece lives in ./drivers/md/dm-vdo, dated October 2026, and you've been reading check_code(9) the entire time. slay. π¦β¨π₯
π¦ 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