Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:assoc_array_insert - Script insertion of an object into an associative array*@array: The array to insert into

Proto:struct assoc_array_edit *assoc_array_insert(struct assoc_array *array, const struct assoc_array_ops *ops, const void *index_key, void *object)

Type:struct assoc_array_edit

Parameter:

TypeParameterName
struct assoc_array *array
const struct assoc_array_ops *ops
const void *index_key
void *object
972  pr_devel("-->%s()\n", __func__)
979  BUG_ON(assoc_array_ptr_is_meta(object))
981  edit = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).
982  If Not edit Then Return ERR_PTR( - ENOMEM)
984  array = array
985  ops = ops
986  leaf = assoc_array_leaf_to_ptr(object)
987  adjust_count_by = 1
990  Case Navigate through the internal tree looking for the closest node to the key. == assoc_array_walk_tree_empty
992  If Not Handle insertion into an empty tree. Then Go to enomem
994  Return edit
996  Case Navigate through the internal tree looking for the closest node to the key. == assoc_array_walk_found_terminal_node
1001  If Not Handle insertion into a terminal node. Then Go to enomem
1004  Return edit
1006  Case Navigate through the internal tree looking for the closest node to the key. == assoc_array_walk_found_wrong_shortcut
1010  If Not Handle insertion into the middle of a shortcut. Then Go to enomem
1012  Return edit
1015  enomem :
1017  pr_devel("enomem\n")
1018  assoc_array_cancel_edit - Discard an edit script
1019  Return ERR_PTR( - ENOMEM)