函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:search - binary search an array of elements*@key: pointer to item being searched for*@base: pointer to first element to search*@num: number of elements*@size: size of each element*@cmp: pointer to comparison function

函数原型:void *bsearch(const void *key, const void *base, size_t num, size_t size, cmp_func_t cmp)

返回类型:void

参数:

类型参数名称
const void *key
const void *base
size_tnum
size_tsize
cmp_func_tcmp
37 num大于0循环
38  pivot等于basenum右移1位的值乘size
39  result等于cmp(key, pivot)
41  如果result恒等于0则返回:pivot
44  如果result大于0则
45  base等于pivotsize
46  num自减
48  num右移等于1位
51  返回:NULL
调用者
名称描述
map_id_range_down_maxmap_id_range_down_max - Find idmap via binary search in ordered idmap array.* Can only be called if number of mappings exceeds UID_GID_MAP_MAX_BASE_EXTENTS.
map_id_up_maxmap_id_up_max - Find idmap via binary search in ordered idmap array.* Can only be called if number of mappings exceeds UID_GID_MAP_MAX_BASE_EXTENTS.
find_subprog
search_extableSearch one exception table for an entry corresponding to the* given instruction address, and return the address of the entry,* or NULL if none is found.* We use a binary search, and thus we assume that the table is* already sorted.
poke_int3_handler
find_exported_symbol_in_section