kunit_remove_resource(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ 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 via alloc_and_get or find; in this case a final call to kunit_put_resource is 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:


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