函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Destructively iterate over an associative array. The caller must prevent* other simultaneous accesses.

函数原型:static void assoc_array_destroy_subtree(struct assoc_array_ptr *root, const struct assoc_array_ops *ops)

返回类型:void

参数:

类型参数名称
struct assoc_array_ptr *root
const struct assoc_array_ops *ops
348  struct assoc_array_ptr * cursor, * parent = NULL
349  slot等于负1
351  打印调试信息("-->%s()\n", __func__)
353  cursor等于root
354  如果非cursor
355  打印调试信息("empty\n")
356  返回
359  move_to_meta :
360  如果assoc_array_ptr_is_shortcut(cursor)则
362  打印调试信息("[%d] shortcut\n", slot)
363  BUG_ON(!assoc_array_ptr_is_shortcut(cursor))
364  shortcut等于assoc_array_ptr_to_shortcut(cursor)
365  BUG_ON(back_pointer != parent)
366  BUG_ON(slot != - 1 && parent_slot != slot)
367  parent等于cursor
368  cursor等于next_node
369  slot等于负1
370  BUG_ON(!assoc_array_ptr_is_node(cursor))
373  打印调试信息("[%d] node\n", slot)
374  node等于assoc_array_ptr_to_node(cursor)
375  BUG_ON(back_pointer != parent)
376  BUG_ON(slot != - 1 && parent_slot != slot)
377  slot等于0
379  continue_node :
380  打印调试信息("Node %p [back=%p]\n", node, back_pointer)
381 slot小于Number of slots per node 循环
382  ptr等于slots[slot]
383  如果非ptr则继续下一循环
385  如果assoc_array_ptr_is_meta(ptr)则
386  parent等于cursor
387  cursor等于ptr
388  转到:move_to_meta
391  如果ops
392  打印调试信息("[%d] free leaf\n", slot)
397  parent等于back_pointer
398  slot等于parent_slot
399  打印调试信息("free node\n")
400  kfree(node)
401  如果非parent则返回
406  如果assoc_array_ptr_is_shortcut(parent)则
407  shortcut等于assoc_array_ptr_to_shortcut(parent)
408  BUG_ON(next_node != cursor)
409  cursor等于parent
410  parent等于back_pointer
411  slot等于parent_slot
412  打印调试信息("free shortcut\n")
413  kfree(shortcut)
414  如果非parent则返回
417  BUG_ON(!assoc_array_ptr_is_node(parent))
421  打印调试信息("ascend to %p[%d]\n", parent, slot)
422  cursor等于parent
423  node等于assoc_array_ptr_to_node(cursor)
424  slot自加
425  转到:continue_node
调用者
名称描述
assoc_array_destroyassoc_array_destroy - Destroy an associative array*@array: The array to destroy.*@ops: The operations to use.* Discard all metadata and free all objects in an associative array. The* array will be empty and ready to use again upon completion. This function
assoc_array_rcu_cleanup
assoc_array_gcassoc_array_gc - Garbage collect an associative array