函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

函数原型:void *__genradix_ptr_alloc(struct __genradix *radix, size_t offset, gfp_t gfp_mask)

返回类型:void

参数:

类型参数名称
struct __genradix *radix
size_toffset
gfp_tgfp_mask
107  v等于READ_ONCE(root)
108  struct genradix_node * n, * new_node = NULL
112  当1循环
113  r等于v
115  n等于genradix_root_to_node(r)
116  level等于genradix_root_to_depth(r)
118  如果nlog2 - 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)则退出
121  如果非new_node
123  如果非new_node则返回:NULL
127  Interior node: [0]等于n
128  new_root等于new_node按位或如果nlevel加1否则0
131  如果v等于cmpxchg_release( & root, r, new_root)恒等于r
132  v等于new_root
133  new_node = NULL
137 level自减循环
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  如果非n
144  如果非new_node
146  如果非new_node则返回:NULL
155  如果new_nodegenradix_free_node(new_node)
158  返回: Leaf: [offset]
调用者
名称描述
__genradix_prealloc