Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:bpf_map_meta_alloc

Proto:struct bpf_map *bpf_map_meta_alloc(int inner_map_ufd)

Type:struct bpf_map

Parameter:

TypeParameterName
intinner_map_ufd
15  f = fdget(inner_map_ufd)
16  inner_map = error is returned, fd is released.* On success caller should complete fd access with matching fdput()
17  If IS_ERR(inner_map) Then Return inner_map
23  If map_type == BPF_MAP_TYPE_PROG_ARRAY || map_type == BPF_MAP_TYPE_CGROUP_STORAGE || map_type == BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE Then
26  fdput(f)
27  Return ERR_PTR( - Operation is not supported )
31  If inner_map_meta Then
32  fdput(f)
33  Return ERR_PTR( - EINVAL)
36  If map_value_has_spin_lock(inner_map) Then
37  fdput(f)
38  Return ERR_PTR( - Operation is not supported )
41  inner_map_meta_size = size of inner_map_meta
43  If The first two cachelines with read-mostly members of which some * are also accessed in fast-path (e.g. ops, max_entries). == array_map_ops Then inner_map_meta_size = sizeof(structbpf_array)
46  inner_map_meta = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).
47  If Not inner_map_meta Then
48  fdput(f)
49  Return ERR_PTR( - ENOMEM)
52  map_type = map_type
53  key_size = key_size
54  value_size = value_size
55  map_flags = map_flags
56  max_entries = max_entries
57  >=0 valid offset, <0 error = >=0 valid offset, <0 error
60  The first two cachelines with read-mostly members of which some * are also accessed in fast-path (e.g. ops, max_entries). = The first two cachelines with read-mostly members of which some * are also accessed in fast-path (e.g. ops, max_entries).
61  If The first two cachelines with read-mostly members of which some * are also accessed in fast-path (e.g. ops, max_entries). == array_map_ops Then
62  unpriv_array = unpriv_array
63  ({
63  Do
63  When 0 cycle
63  ({})->index_mask = ({
64  __mptr = inner_map
64  Do
64  When 0 cycle
64  })->index_mask
67  fdput(f)
68  Return inner_map_meta
Caller
NameDescribe
array_of_map_alloc
htab_of_map_alloc