Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Returns pointer to the specified byte @offset within @radix, allocating it if* necessary - newly allocated slots are always zeroed out:

Proto:void *__genradix_ptr_alloc(struct __genradix *radix, size_t offset, gfp_t gfp_mask)

Type:void

Parameter:

TypeParameterName
struct __genradix *radix
size_toffset
gfp_tgfp_mask
107  v = READ_ONCE(root)
108  struct genradix_node * n, * new_node = NULL
112  When 1 cycle
113  r = v
115  n = genradix_root_to_node(r)
116  level = genradix_root_to_depth(r)
118  If n && 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 (offset) < genradix_depth_shift(level) Then Break
121  If Not new_node Then
123  If Not new_node Then Return NULL
127  Interior node: [0] = n
128  new_root = new_node | If n Then level + 1 Else 0
131  If (v = cmpxchg_release( & root, r, new_root)) == r Then
132  v = new_root
133  new_node = NULL
137  When level-- cycle
138  p = Interior node: [offset >> genradix_depth_shift(level)]
140  offset &= Returns size (of data, in bytes) that a tree of a given depth holds: - 1
142  n = READ_ONCE( * p)
143  If Not n Then
144  If Not new_node Then
146  If Not new_node Then Return NULL
155  If new_node Then genradix_free_node(new_node)
158  Return Leaf: [offset]
Caller
NameDescribe
__genradix_prealloc