函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\bpf\hashtab.c Create Date:2022-07-27 14:25:38
Last Modify:2022-05-23 09:15:29 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Called from syscall

函数原型:static int htab_map_get_next_key(struct bpf_map *map, void *key, void *next_key)

返回类型:int

参数:

类型参数名称
struct bpf_map *map
void *key
void *next_key
599  htab等于container_of - cast a member of a structure out to the containing structure*@ptr: the pointer to the member.*@type: the type of the container struct this is embedded in.*@member: the name of the member within the struct.(map, structbpf_htab, map)
603  i等于0
605  WARN_ON_ONCE(!_read_lock_held() - might we be in RCU read-side critical section?* If CONFIG_DEBUG_LOCK_ALLOC is selected, returns nonzero iff in an RCU* read-side critical section)
607  key_size等于key_size
609  如果非key则转到:find_first_elem
612  hash等于htab_map_hash(key, key_size, hashrnd)
614  head等于select_bucket(htab, hash)
617  l等于an be called without bucket lock. it will repeat the loop in* the unlikely event when elements moved from one bucket into another* while link list is being walked
619  如果非l则转到:find_first_elem
623  next_l等于hlist_nulls_entry_safe(Dependency order vs. p above. (hlist_nulls_next_rcu( & hash_node)), structhtab_elem, hash_node)
626  如果next_l
628  内存复制(next_key, key, key_size)
629  返回:0
633  i等于hash按位与 number of hash buckets 减1
634  i自加
636  find_first_elem :
638 i小于 number of hash buckets 循环
639  head等于select_bucket(htab, i)
642  next_l等于hlist_nulls_entry_safe(Dependency order vs. p above. (hlist_nulls_first_rcu(head)), structhtab_elem, hash_node)
644  如果next_l
647  返回:0
652  返回:负ENOENT