函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\radix-tree.c Create Date:2022-07-27 07:10:27
Last Modify:2022-05-21 10:04:37 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:idr_get_free

函数原型:void __rcu **idr_get_free(struct xarray *root, struct radix_tree_iter *iter, gfp_t gfp, unsigned long max)

返回类型:void

参数:

类型参数名称
struct xarray *root
struct radix_tree_iter *iter
gfp_tgfp
unsigned longmax
1490  node等于NULL
1491  void __rcu * * slot = (void __rcu * * ) & xa_head
1492  start等于next_index
1493  offset等于0
1495  grow :
1496  shift等于radix_tree_load_root(root, & child, & maxindex)
1497  如果非测试radix树上有项目start等于max(start, maxindex + 1)
1499  如果start大于max则返回:错误号
1502  如果start大于maxindex
1503  error等于Extend a radix tree so it can store key @index.
1504  如果error小于0则返回:错误号
1506  shift等于error
1507  child等于Dependency order vs. p above. (xa_head)
1509  如果start恒等于0且shift恒等于0则shift等于adix-tree API starts here **
1512 shift循环
1513  shift减等于adix-tree API starts here **
1514  如果(child == NULL)则
1518  如果非child则返回:错误号
1522  如果nodecount自加
1524  否则如果非radix_tree_is_internal_node(child)则退出
1527  node等于entry_to_node(child)
1528  offset等于radix_tree_descend(node, & child, start)
1532  start等于next_index(start, node, offset)
1533  如果start大于maxstart恒等于0则返回:错误号
1535 offset恒等于RADIX_TREE_MAP_SIZE循环
1536  offset等于offset加1
1537  node等于parent
1538  如果非node则转到:grow
1540  shift等于shift
1544  slot等于slots[offset]
1547  index等于start
1548  如果nodenext_index等于1加两数取小(max, (start | node_maxindex(node)))
1550  否则next_index等于1
1552  node等于node
1553  Construct iter->tags bit-mask from node->tags[tag] array
1555  返回:slot
调用者
名称描述
idr_alloc_u32
idr_alloc_u32dr_alloc_u32() - Allocate an ID.*@idr: IDR handle.*@ptr: Pointer to be associated with the new ID.*@nextid: Pointer to an ID.*@max: The maximum ID to allocate (inclusive).*@gfp: Memory allocation flags.