Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\bpf\local_storage.c Create Date:2022-07-28 13:14:08
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:cgroup_storage_update_elem

Proto:static int cgroup_storage_update_elem(struct bpf_map *map, void *_key, void *value, u64 flags)

Type:int

Parameter:

TypeParameterName
struct bpf_map *map
void *_key
void *value
u64flags
130  key = _key
134  If Value for the false possibility is greater at compile time(flags & ~(spin_lock-ed map_lookup/map_update | update existing element | create new element if it didn't exist )) Then Return -EINVAL
137  If Value for the false possibility is greater at compile time(flags & create new element if it didn't exist ) Then Return -EINVAL
140  If Value for the false possibility is greater at compile time((flags & spin_lock-ed map_lookup/map_update ) && !map_value_has_spin_lock(map)) Then Return -EINVAL
144  storage = cgroup_storage_lookup((structbpf_cgroup_storage_map * )map, key, false)
146  If Not storage Then Return -ENOENT
149  If flags & spin_lock-ed map_lookup/map_update Then
150  copy_map_value_locked(map, data, value, false)
151  Return 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  If Not new Then Return -ENOMEM
161  No 3D Now!( & 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  Return 0