函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:array_map_check_btf

函数原型: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)

返回类型:int

参数:

类型参数名称
const struct bpf_map *map
const struct btf *btf
const struct btf_type *key_type
const struct btf_type *value_type
457  如果btf_type_is_void(key_type)则
458  如果map_type不等于BPF_MAP_TYPE_ARRAYmax_entries不等于1则返回:负EINVAL
462  如果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 则返回:负EINVAL
465  返回:0
468  如果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 则返回:负EINVAL
471  int_data等于*key_type加1的和
475  如果BTF_INT_BITS(int_data)不等于32或BTF_INT_OFFSET(int_data)则返回:负EINVAL
478  返回:0