函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:cgroup_storage_update_elem

函数原型:static int cgroup_storage_update_elem(struct bpf_map *map, void *_key, void *value, u64 flags)

返回类型:int

参数:

类型参数名称
struct bpf_map *map
void *_key
void *value
u64flags
130  key等于_key
134  如果此条件成立可能性小(为编译器优化)(flags & ~(spin_lock-ed map_lookup/map_update | update existing element | create new element if it didn't exist ))则返回:负EINVAL
137  如果此条件成立可能性小(为编译器优化)(flags & create new element if it didn't exist )则返回:负EINVAL
140  如果此条件成立可能性小(为编译器优化)((flags & spin_lock-ed map_lookup/map_update ) && !map_value_has_spin_lock(map))则返回:负EINVAL
144  storage等于cgroup_storage_lookup((structbpf_cgroup_storage_map * )map, key, false)
146  如果非storage则返回:负ENOENT
149  如果flags按位与spin_lock-ed map_lookup/map_update
150  copy_map_value_locked(map, data, value, false)
151  返回:0
154  new等于kmalloc_node(sizeof(structbpf_storage_buffer) + value_size, __GFP_ZERO | DOC: Useful GFP flag combinations* Useful GFP flag combinations* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~* Useful GFP flag combinations that are commonly used. It is recommended* that subsystems start with one of these combinations and then set/clear | DOC: Action modifiers* Action modifiers* ~~~~~~~~~~~~~~~~* %__GFP_NOWARN suppresses allocation failure reports.* %__GFP_COMP address compound page metadata.* %__GFP_ZERO returns a zeroed page on success., numa_node)
158  如果非new则返回:负ENOMEM
161  内存复制( & data[0], value, value_size)
162  check_and_init_map_lock(map, data)
164  new等于xchg( & buf, new)
165  kfree_rcu() - kfree an object after a grace period(new, rcu)
167  返回:0