get_next_state(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ get_next_state(9) ✨

okay so this is a page from the Kernel API Manual, bestie, and it's about one very specific little function called get_next_state. Think of it as the vibe-check function for admin state transitions πŸ’…


🌸 NAME 🌸

get_next_state β€” figure out which state should be set after a given operation finishes, based on the operation plus the current state. that's literally it, that's the whole job 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

const struct admin_state_code * get_next_state (const struct admin_state
*state , const struct admin_state_code *operation );

πŸŽ€ ARGUMENTS πŸŽ€

  • state β€” the current admin state. like, where we're at right now πŸ‘€
  • operation β€” the operation that's about to be started πŸ”₯

⭐ RETURN ⭐

it hands you back the state you should set once the operation completes ✨

or it returns NULL if the operation can't even be started in the current state β€” so like, no, bestie, wrong vibe, can't go there 😭


🌈 SEE ALSO 🌈

the kernel file lives at ./drivers/md/dm-vdo/admin-state.c β€” and here's the whole friend group, no cap:


πŸ’€ real talk: if get_next_state gives you NULL, do not just start the operation anyway. it's telling you the transition isn't valid from where you are. respect the vibe check, bestie.

and that's the whole page, mwah πŸ’‹ it's from ./drivers/md/dm-vdo, dated October 2026 β€” iconic of them honestly, periodt πŸŒŸπŸ’–

πŸ“¦ where this page comes from