函数逻辑报告 |
Source Code:kernel\bpf\hashtab.c |
Create Date:2022-07-27 14:25:57 |
Last Modify:2022-05-23 09:15:29 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:Called from syscall or from eBPF program
函数原型:static int htab_map_update_elem(struct bpf_map *map, void *key, void *value, u64 map_flags)
返回类型:int
参数:
类型 | 参数 | 名称 |
---|---|---|
struct bpf_map * | map | |
void * | key | |
void * | value | |
u64 | map_flags |
830 | 如果此条件成立可能性小(为编译器优化)((map_flags & ~spin_lock-ed map_lookup/map_update ) > update existing element )则返回:负EINVAL |
834 | 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) |
838 | hash等于htab_map_hash(key, key_size, hashrnd) |
840 | b等于__select_bucket(htab, hash) |
844 | 如果此条件成立可能性小(为编译器优化)(!map_value_has_spin_lock(map))则返回:负EINVAL |
847 | l_old等于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 |
849 | ret等于check_flags(htab, l_old, map_flags) |
852 | 如果l_old则 |
857 | 返回:0 |
866 | raw_spin_lock_irqsave( & lock, flags) |
870 | ret等于check_flags(htab, l_old, map_flags) |
874 | 如果此条件成立可能性小(为编译器优化)(l_old && (map_flags & spin_lock-ed map_lookup/map_update ))则 |
884 | ret等于0 |
885 | 转到:err |
890 | 如果是错误则 |
900 | 如果l_old则 |
902 | 如果非htab_is_prealloc(htab)则free_htab_elem(htab, l_old) |
905 | ret等于0 |
906 | err : |
907 | raw_spin_unlock_irqrestore( & lock, flags) |
908 | 返回:ret |
名称 | 描述 |
---|---|
bpf_fd_htab_map_update_elem | ly called from syscall |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |