get_next_state(9)
β¨ 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:
vdo_finish_operation(9)begin_operation(9)start_operation(9)check_code(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)
π real talk: ifget_next_stategives youNULL, 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
- 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