check_code(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 β€” True if 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 be NULL. 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, waiter being allowed to be NULL is 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:


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