函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Handle insertion into the middle of a shortcut.

函数原型:static bool assoc_array_insert_mid_shortcut(struct assoc_array_edit *edit, const struct assoc_array_ops *ops, struct assoc_array_walk_result *result)

返回类型:bool

参数:

类型参数名称
struct assoc_array_edit *edit
const struct assoc_array_ops *ops
struct assoc_array_walk_result *result
804  shortcut等于shortcut
805  level等于level
806  sc_level等于sc_level
807  sc_segments等于sc_segments
808  dissimilarity等于dissimilarity
810  打印调试信息("-->%s(ix=%d dis=%lx scix=%d)\n", __func__, level, dissimilarity, sc_level)
819  diff等于在字中找到第一个指定位
820  diff与等于ASSOC_ARRAY_LEVEL_STEP_MASK的反
821  diff加等于sc_level按位与ASSOC_ARRAY_KEY_CHUNK_MASK的反
822  打印调试信息("diff=%d\n", diff)
824  如果非back_pointer
825  ptr等于The node at the root of the tree
826  否则如果assoc_array_ptr_is_node(back_pointer)则
827  node等于assoc_array_ptr_to_node(back_pointer)
828  ptr等于slots[parent_slot]
829  否则
830  BUG()
833  excised_meta[0]等于assoc_array_shortcut_to_ptr(shortcut)
836  new_n0等于分配内存并置零
837  如果非new_n0则返回:false
839  new_meta[0]等于assoc_array_node_to_ptr(new_n0)
840  adjust_count_on等于new_n0
846  level加等于ASSOC_ARRAY_LEVEL_STEP
847  如果diff大于level
848  打印调试信息("pre-shortcut %d...%d\n", level, diff)
849  keylen等于und_up - round up to next specified power of 2*@x: the value to round*@y: multiple to round up to (must be a power of 2)* Rounds @x up to next multiple of @y (which must be a power of 2).* To perform arbitrary rounding up, use roundup() below.(diff, Key data retrieved in chunks of this size )
850  keylen右移等于ASSOC_ARRAY_KEY_CHUNK_SHIFT
852  new_s0等于分配内存并置零
854  如果非new_s0则返回:false
856  new_meta[1]等于assoc_array_shortcut_to_ptr(new_s0)
857  to等于assoc_array_shortcut_to_ptr(new_s0)
858  back_pointer等于back_pointer
859  parent_slot等于parent_slot
860  next_node等于assoc_array_node_to_ptr(new_n0)
861  skip_to_level等于diff
863  back_pointer等于assoc_array_shortcut_to_ptr(new_s0)
864  parent_slot等于0
866  内存复制(index_key, index_key, keylen * sizeof(unsignedlong))
869  blank等于ULONG_MAX左移diff按位与ASSOC_ARRAY_KEY_CHUNK_MASK的值位
870  打印调试信息("blank off [%zu] %d: %lx\n", keylen - 1, diff, blank)
871  index_key[keylen - 1]与等于blank的反
872  否则
873  打印调试信息("no pre-shortcut\n")
874  to等于assoc_array_node_to_ptr(new_n0)
875  back_pointer等于back_pointer
876  parent_slot等于parent_slot
879  side等于assoc_array_ptr_to_node(next_node)
880  nr_leaves_on_branch等于nr_leaves_on_branch
885  sc_slot等于sc_segments右移diff按位与ASSOC_ARRAY_KEY_CHUNK_MASK的值位
886  sc_slot与等于ASSOC_ARRAY_FAN_MASK
888  打印调试信息("new slot %lx >> %d -> %d\n", sc_segments, diff & ASSOC_ARRAY_KEY_CHUNK_MASK, sc_slot)
896  level等于diffASSOC_ARRAY_LEVEL_STEP
897  如果level小于skip_to_level
898  打印调试信息("post-shortcut %d...%d\n", level, skip_to_level)
899  keylen等于und_up - round up to next specified power of 2*@x: the value to round*@y: multiple to round up to (must be a power of 2)* Rounds @x up to next multiple of @y (which must be a power of 2).* To perform arbitrary rounding up, use roundup() below.(skip_to_level, Key data retrieved in chunks of this size )
900  keylen右移等于ASSOC_ARRAY_KEY_CHUNK_SHIFT
902  new_s1等于分配内存并置零
904  如果非new_s1则返回:false
906  new_meta[2]等于assoc_array_shortcut_to_ptr(new_s1)
908  back_pointer等于assoc_array_node_to_ptr(new_n0)
909  parent_slot等于sc_slot
910  next_node等于next_node
911  skip_to_level等于skip_to_level
913  slots[sc_slot]等于assoc_array_shortcut_to_ptr(new_s1)
915  内存复制(index_key, index_key, keylen * sizeof(unsignedlong))
918  ptr等于back_pointer
919  to等于assoc_array_shortcut_to_ptr(new_s1)
920  否则
921  打印调试信息("no post-shortcut\n")
928  slots[sc_slot]等于next_node
929  p等于parent_slot
930  to等于sc_slot
931  ptr等于back_pointer
932  to等于assoc_array_node_to_ptr(new_n0)
936  如果sc_slot恒等于0则leaf_p等于slots[1]
938  否则leaf_p等于slots[0]
941  打印调试信息("<--%s() = ok [split shortcut]\n", __func__)
942  返回:edit
调用者
名称描述
assoc_array_insertassoc_array_insert - Script insertion of an object into an associative array*@array: The array to insert into