kunit_find_resource(9)
π kunit_find_resource β a Kernel API Manual moment β¨
okay so bestie, we're in the Kernel API Manual today and the vibe is resource hunting π lowkey this one is iconic β it's kunit_find_resource and it does exactly what it says on the tin, no cap.
πΈ NAME πΈ
kunit_find_resource β find a resource using match function/data π¦
β¨ SYNOPSIS β¨
struct kunit_resource * kunit_find_resource (struct kunit *test ,
kunit_resource_match_t match , void *match_data );
literally just hand it the test, the match function, and the match data and it goes off to find your resource π
π«Ά ARGUMENTS π«Ά
testβ the test case that the resource belongs to π like, whose resource are we even looking for, ykwimmatchβ the match function, and it gets applied to the resources and the match data π₯ this is the little detective doing the actual sleuthingmatch_dataβ the data used in matching π the detective's clues, if you will
π§ SEE ALSO π§
Kernel file ./include/kunit/resource.h β and honestly the whole friend group showed up to the group chat, so let's give them their flowers π:
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_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)kunit_release_action(9)
ngl bestie, that's a lot of siblings, but they all slay in their own way πβ¨
anyway that's the whole page π this one came straight out of ./include/kunit and it's dated October 2026 β so yeah, manifesting that future knowledge fr fr πβ mwah, study hard, ily π
π¦ 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