函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Iterate over an associative array. The caller must hold the RCU read lock* or better.

函数原型:static int assoc_array_subtree_iterate(const struct assoc_array_ptr *root, const struct assoc_array_ptr *stop, int (*iterator)(const void *leaf, void *iterator_data), void *iterator_data)

返回类型:int

参数:

类型参数名称
const struct assoc_array_ptr *root
const struct assoc_array_ptr *stop
int (*iterator
void *iterator_data
31  cursor等于root
33  begin_node :
34  如果assoc_array_ptr_is_shortcut(cursor)则
36  shortcut等于assoc_array_ptr_to_shortcut(cursor)
37  cursor等于READ_ONCE(next_node)
40  node等于assoc_array_ptr_to_node(cursor)
41  slot等于0
50  has_meta等于0
51 slot小于Number of slots per node 循环
52  ptr等于READ_ONCE(slots[slot])
53  has_meta或等于ptr
54  如果ptrassoc_array_ptr_is_leaf(ptr)则
61  如果ret则返回:ret
74  如果非has_meta按位与Points to node or shortcut 的值则转到:finished_node
76  slot等于0
78  continue_node :
79  node等于assoc_array_ptr_to_node(cursor)
80 slot小于Number of slots per node 循环
81  ptr等于READ_ONCE(slots[slot])
82  如果assoc_array_ptr_is_meta(ptr)则
83  cursor等于ptr
84  转到:begin_node
88  finished_node :
90  parent等于READ_ONCE(back_pointer)
91  slot等于parent_slot
92  如果parent恒等于stop则返回:0
95  如果assoc_array_ptr_is_shortcut(parent)则
96  shortcut等于assoc_array_ptr_to_shortcut(parent)
97  cursor等于parent
98  parent等于READ_ONCE(back_pointer)
99  slot等于parent_slot
100  如果parent恒等于stop则返回:0
105  cursor等于parent
106  slot自加
107  转到:continue_node
调用者
名称描述
assoc_array_iterateassoc_array_iterate - Pass all objects in the array to a callback*@array: The array to iterate over.*@iterator: The callback function.*@iterator_data: Private data for the callback function.* Iterate over all the objects in an associative array
assoc_array_deleteassoc_array_delete - Script deletion of an object from an associative array*@array: The array to search.*@ops: The operations to use.*@index_key: The key to the object.* Precalculate and preallocate a script for the deletion of an object from an