Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:array_map_check_btf

Proto:static int array_map_check_btf(const struct bpf_map *map, const struct btf *btf, const struct btf_type *key_type, const struct btf_type *value_type)

Type:int

Parameter:

TypeParameterName
const struct bpf_map *map
const struct btf *btf
const struct btf_type *key_type
const struct btf_type *value_type
457  If btf_type_is_void(key_type) Then
458  If map_type != BPF_MAP_TYPE_ARRAY || max_entries != 1 Then Return -EINVAL
462  If BTF_INFO_KIND( "info" bits arrangement * bits 0-15: vlen (e.g. # of struct's members) * bits 16-23: unused * bits 24-27: kind (e.g. int, ptr, array...etc) * bits 28-30: unused * bit 31: kind_flag, currently used by * struct, union and fwd) != Section Then Return -EINVAL
465  Return 0
468  If BTF_INFO_KIND( "info" bits arrangement * bits 0-15: vlen (e.g. # of struct's members) * bits 16-23: unused * bits 24-27: kind (e.g. int, ptr, array...etc) * bits 28-30: unused * bit 31: kind_flag, currently used by * struct, union and fwd) != Integer Then Return -EINVAL
471  int_data = *(key_type + 1)
475  If BTF_INT_BITS(int_data) != 32 || BTF_INT_OFFSET(int_data) Then Return -EINVAL
478  Return 0