Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\kunit\test.c Create Date:2022-07-28 06:38:48
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:kunit_alloc_and_get_resource

Proto: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)

Type:struct kunit_resource

Parameter:

TypeParameterName
struct kunit *test
kunit_resource_init_tinit
kunit_resource_free_tfree
gfp_tinternal_gfp
void *context
330  res = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).
331  If Not res Then Return NULL
334  ret = init(res, context)
335  If ret Then Return NULL
338  free = free
339  spin_lock( & Guards all mutable test state. )
340  list_add_tail - add a new entry*@new: new entry to be added*@head: list head to add it before* Insert a new entry before the specified head.* This is useful for implementing queues.
341  spin_unlock( & Guards all mutable test state. )
343  Return res
Caller
NameDescribe
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*