Lines Matching full:resource
3 * KUnit resource API for test managed resources (allocations, etc.).
25 * struct kunit_resource - represents a *test managed resource*
28 * @free: a user supplied function to free the resource.
30 * Represents a *test managed resource*, a resource which will automatically be
36 * Resources are reference counted so if a resource is retrieved via
38 * to call kunit_put_resource() to reduce the resource reference count
40 * kunit_resource_put() because it does not retrieve the resource itself.
80 * and kunit_destroy_named_resource(). Resource names must be
95 * kunit_get_resource() - Hold resource for use. Should not need to be used
98 * @res: resource
125 * kunit_put_resource() - When caller is done with retrieved resource,
127 * reference count. The resource list maintains
129 * are utilizing a resource and it is removed from
130 * the resource list, it will be freed via the
133 * find() resource.
134 * @res: resource
142 * __kunit_add_resource() - Internal helper to add a resource.
147 * none is supplied, the resource data value is simply set to @data.
149 * @free: a user-supplied function to free the resource (if needed).
150 * @res: The resource.
151 * @data: value to pass to init function or set in resource data field.
160 * kunit_add_resource() - Add a *test managed resource*.
163 * none is supplied, the resource data value is simply set to @data.
165 * @free: a user-supplied function to free the resource (if needed).
166 * @res: The resource.
167 * @data: value to pass to init function or set in resource data field.
183 * kunit_add_named_resource() - Add a named *test managed resource*.
185 * @init: a user-supplied function to initialize the resource data, if needed.
186 * @free: a user-supplied function to free the resource data, if needed.
187 * @res: The resource.
188 * @name: name to be set for resource.
189 * @data: value to pass to init function or set in resource data field.
216 * kunit_alloc_and_get_resource() - Allocates and returns a *test managed resource*.
218 * @init: a user supplied function to initialize the resource.
219 * @free: a user supplied function to free the resource (if needed).
223 * Allocates a *test managed resource*, a resource which will automatically be
229 * also increments the resource's refcount, so kunit_put_resource() should be
234 * resource.
265 * kunit_alloc_resource() - Allocates a *test managed resource*.
267 * @init: a user supplied function to initialize the resource.
268 * @free: a user supplied function to free the resource (if needed).
272 * Allocates a *test managed resource*, a resource which will automatically be
278 * resource.
304 * kunit_resource_name_match() - Match a resource with the same name.
305 * @test: Test case to which the resource belongs.
306 * @res: The resource.
317 * kunit_find_resource() - Find a resource using match function/data.
318 * @test: Test case to which the resource belongs.
346 * kunit_find_named_resource() - Find a resource using match name.
347 * @test: Test case to which the resource belongs.
360 * @test: Test case to which the resource belongs.
361 * @match: Match function. Returns whether a given resource matches @match_data.
379 * kunit_remove_resource() - remove resource from resource list associated with
382 * @res: The resource to be removed.
384 * Note that the resource will not be immediately freed since it is likely