函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\kunit\test.c Create Date:2022-07-27 07:36:26
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:kunit_alloc_and_get_resource

函数原型:struct kunit_resource *kunit_alloc_and_get_resource(struct kunit *test, kunit_resource_init_t init, kunit_resource_free_t free, gfp_t internal_gfp, void *context)

返回类型:struct kunit_resource

参数:

类型参数名称
struct kunit *test
kunit_resource_init_tinit
kunit_resource_free_tfree
gfp_tinternal_gfp
void *context
330  res等于分配内存并置零
331  如果非res则返回:NULL
334  ret等于init(res, context)
335  如果ret则返回:NULL
338  free等于free
339  加自旋锁
340  添加链表项
341  自旋锁解锁
343  返回:res
调用者
名称描述
kunit_resource_test_alloc_resource
kunit_resource_test_destroy_resource
kunit_resource_test_cleanup_resources
fake_resource_1_init
kunit_resource_test_proper_free_orderingTODO(brendanhiggins@google.com): replace the arrays that keep track of the* order of allocation and freeing with strict mocks using the IN_SEQUENCE macro* to assert allocation and freeing order when the feature becomes available.
kunit_alloc_resourcekunit_alloc_resource() - Allocates a *test managed resource*