Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:sbitmap_init_node

Proto:int sbitmap_init_node(struct sbitmap *sb, unsigned int depth, int shift, gfp_t flags, int node)

Type:int

Parameter:

TypeParameterName
struct sbitmap *sb
unsigned intdepth
intshift
gfp_tflags
intnode
50  If shift < 0 Then
51  shift = log2 - log base 2 of 32-bit or a 64-bit unsigned value*@n: parameter* constant-capable log of base 2 calculation* - this can be used to initialise global variables from constant data, hence* the massive ternary operator construction* selects the (BITS_PER_LONG)
58  If depth >= 4 Then
59  When 4U << shift > depth cycle
60  shift--
63  bits_per_word = 1U << shift
64  If bits_per_word > BITS_PER_LONG Then Return -EINVAL
67  @shift: log2(number of bits used per word) = shift
68  @depth: Number of bits used in the whole bitmap. = depth
69  @map_nr: Number of words (cachelines) being used for the bitmap. = DIV_ROUND_UP(@depth: Number of bits used in the whole bitmap., bits_per_word)
71  If depth == 0 Then
72  @map: Allocated bitmap. = NULL
73  Return 0
76  @map: Allocated bitmap. = kcalloc_node(@map_nr: Number of words (cachelines) being used for the bitmap., size of @map: Allocated bitmap. , flags, node)
77  If Not @map: Allocated bitmap. Then Return -ENOMEM
80  When i < @map_nr: Number of words (cachelines) being used for the bitmap. cycle
81  @depth: Number of bits being used in @word/@cleared = min - return minimum of two values of the same or compatible types*@x: first value*@y: second value(depth, bits_per_word)
82  depth -= @depth: Number of bits being used in @word/@cleared
83  Process spin lock initialization( & @swap_lock: Held while swapping word <-> cleared)
85  Return 0
Caller
NameDescribe
sbitmap_queue_init_node
kyber_init_hctx