kunit_release_action(9)
π NAME π
bestie, this is kunit_release_action from the Kernel API Manual β Run a matching action call immediately. π
Okay so this is the function that says βactually, letβs do that deferred thing right nowβ instead of waiting for the test to wrap. β¨
β¨ SYNOPSIS β¨
void kunit_release_action (struct kunit *test , kunit_action_t *action ,
void *ctx );
π ARGUMENTS π
testβ Test case the action is associated with. π«Άactionβ The deferred function to trigger. π₯ctxβ The context passed to the deferred function to trigger. π
π¦ DESCRIPTION π¦
Execute a function deferred via kunit_add_action) immediately, rather than when the test ends. Yes bestie, trigger it now β no waiting for the end-of-test cleanup era. πΈ
If the function/context pair was deferred multiple times, it will only be executed once here. The most recent deferral will no longer execute when the test ends. Thatβs the whole vibe: one immediate run, and the latest queued repeat gets cancelled from the end-of-test lineup. π
This line:
kunit_release_action(test, func, ctx);
is equivalent to:
func(ctx);
kunit_remove_action(test, func, ctx);
So itβs literally βcall the func, then remove the matching actionβ β iconic combo, no cap. π
See also: devm_release_action for the devres equivalent. π
π SEE ALSO π
The kernel file ./include/kunit/resource.h is the main character here, and these are all the linked faves:
struct kunit_resource(9)kunit_get_resource(9)kunit_put_resource(9)__kunit_add_resource(9)kunit_add_resource(9)kunit_add_named_resource(9)kunit_alloc_and_get_resource(9)kunit_alloc_resource(9)kunit_resource_name_match(9)kunit_find_resource(9)kunit_find_named_resource(9)kunit_destroy_resource(9)kunit_remove_resource(9)KUNIT_DEFINE_ACTION_WRAPPER(9)kunit_add_action(9)kunit_add_action_or_reset(9)kunit_remove_action(9)
xoxo bestie π β this one comes from ./include/kunit and is dated October 2026 β¨
π¦ 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