• Home
  • Raw
  • Download

Lines Matching refs:res

408 		       struct kunit_resource *res,  in kunit_add_resource()  argument
413 res->free = free; in kunit_add_resource()
414 kref_init(&res->refcount); in kunit_add_resource()
417 ret = init(res, data); in kunit_add_resource()
421 res->data = data; in kunit_add_resource()
425 list_add_tail(&res->node, &test->resources); in kunit_add_resource()
436 struct kunit_resource *res, in kunit_add_named_resource() argument
451 res->name = name; in kunit_add_named_resource()
453 return kunit_add_resource(test, init, free, res, data); in kunit_add_named_resource()
463 struct kunit_resource *res; in kunit_alloc_and_get_resource() local
466 res = kzalloc(sizeof(*res), internal_gfp); in kunit_alloc_and_get_resource()
467 if (!res) in kunit_alloc_and_get_resource()
470 ret = kunit_add_resource(test, init, free, res, data); in kunit_alloc_and_get_resource()
476 kunit_get_resource(res); in kunit_alloc_and_get_resource()
477 return res; in kunit_alloc_and_get_resource()
483 void kunit_remove_resource(struct kunit *test, struct kunit_resource *res) in kunit_remove_resource() argument
486 list_del(&res->node); in kunit_remove_resource()
488 kunit_put_resource(res); in kunit_remove_resource()
495 struct kunit_resource *res = kunit_find_resource(test, match, in kunit_destroy_resource() local
498 if (!res) in kunit_destroy_resource()
501 kunit_remove_resource(test, res); in kunit_destroy_resource()
504 kunit_put_resource(res); in kunit_destroy_resource()
515 static int kunit_kmalloc_init(struct kunit_resource *res, void *context) in kunit_kmalloc_init() argument
519 res->data = kmalloc(params->size, params->gfp); in kunit_kmalloc_init()
520 if (!res->data) in kunit_kmalloc_init()
526 static void kunit_kmalloc_free(struct kunit_resource *res) in kunit_kmalloc_free() argument
528 kfree(res->data); in kunit_kmalloc_free()
548 struct kunit_resource *res; in kunit_kfree() local
550 res = kunit_find_resource(test, kunit_resource_instance_match, in kunit_kfree()
557 kunit_remove_resource(test, res); in kunit_kfree()
559 kunit_put_resource(res); in kunit_kfree()
566 struct kunit_resource *res; in kunit_cleanup() local
583 res = list_last_entry(&test->resources, in kunit_cleanup()
592 kunit_remove_resource(test, res); in kunit_cleanup()