kunit_remove_resource(9)
π kunit_remove_resource(9) π
okay bestie, so we're in the Kernel API Manual today β this is the kunit_remove_resource(9) page, and honestly? it's a short one but it matters. let's get into it π
β¨ NAME β¨
kunit_remove_resource β remove resource from resource list associated with test. that's it. that's the whole gig. she's a deleter, an un-lister, a "you don't sit with us anymore" for test resources π«Ά
πΈ SYNOPSIS πΈ
void kunit_remove_resource (struct kunit *test , struct kunit_resource
*res );
no return value, no drama β void and done β¨
π¦ ARGUMENTS π¦
testβ The test context object. the main character of this whole situation, lowkey πresβ The resource to be removed. the one getting politely escorted out π
π DESCRIPTION π
okay so here's the tea, and it's important tea, so pay attention bestie:
Note that the resource will not be immediately freed since it is likely the caller has a reference to it viaalloc_and_getorfind; in this case a final call tokunit_put_resourceis required.
so like... she's removed from the list, but she is NOT freed yet. this is giving "moved out but still has a key to the apartment" π because most likely you, the caller, are still holding a reference to her via alloc_and_get or find. so if you want her actually gone-gone, you need one final kunit_put_resource call. that's the last step. don't skip it fr fr π
π₯ SEE ALSO π₯
like, all her friends, in order, no cap:
- Kernel file
./include/kunit/resource.h 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_DEFINE_ACTION_WRAPPER(9)kunit_add_action(9)kunit_add_action_or_reset(9)kunit_remove_action(9)kunit_release_action(9)
and that's the page, bestie! π this lil icon lives in ./include/kunit and she's dated October 2026 β remember her fondly, put your reference down, and slay the test suite πβ¨π
π¦ 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