Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Check the invariants for the buffer allocated from a slab cache.* If the cache has a test constructor, the first 4 bytes of the object must* always remain equal to CTOR_PATTERN.* If the cache isn't an RCU-typesafe one, or if the allocation is done with

Proto:static bool __init check_buf(void *buf, int size, bool want_ctor, bool want_rcu, bool want_zero)

Type:bool

Parameter:

TypeParameterName
void *buf
intsize
boolwant_ctor
boolwant_rcu
boolwant_zero
170  bool fail = false
172  bytes = Calculate the number of uninitialized bytes in the buffer.
173  WARN_ON(want_ctor && want_zero)
174  If want_zero Then Return bytes
176  If want_ctor Then
177  If buf != CTOR_PATTERN Then fail = 1
179  Else
180  If bytes Then fail = Not want_rcu
183  Return fail
Caller
NameDescribe
do_kmem_cache_sizeTest kmem_cache with given parameters: