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:18
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:cgroup_storage_map_alloc

Proto:static struct bpf_map *cgroup_storage_map_alloc(union bpf_attr *attr)

Type:struct bpf_map

Parameter:

TypeParameterName
union bpf_attr *attr
273  numa_node = bpf_map_attr_numa_node(attr)
278  If size of key in bytes != sizeof(structbpf_cgroup_storage_key) Then Return ERR_PTR( - EINVAL)
281  If size of value in bytes == 0 Then Return ERR_PTR( - EINVAL)
284  If size of value in bytes > PAGE_SIZE Then Return ERR_PTR( - E2BIG)
287  If BPF_MAP_CREATE related * flags defined above. & ~LOCAL_STORAGE_CREATE_FLAG_MASK || Not bpf_map_flags_access_ok( BPF_MAP_CREATE related * flags defined above.) Then Return ERR_PTR( - EINVAL)
291  If max number of entries in a map Then Return ERR_PTR( - EINVAL)
295  ret = bpf_map_charge_init( & mem, sizeof(structbpf_cgroup_storage_map))
296  If ret < 0 Then Return ERR_PTR(ret)
299  map = kmalloc_node(sizeof(structbpf_cgroup_storage_map), __GFP_ZERO | GFP_USER, numa_node)
301  If Not map Then
302  bpf_map_charge_finish( & mem)
303  Return ERR_PTR( - ENOMEM)
306  bpf_map_charge_move( & memory, & mem)
309  bpf_map_init_from_attr( & map, attr)
311  Process spin lock initialization( & lock)
312  root =
313  Initialization list head
315  Return map