Function report |
Source Code:kernel\bpf\syscall.c |
Create Date:2022-07-28 12:52:08 |
Last Modify:2022-05-19 18:06:12 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:map_check_btf
Proto:static int map_check_btf(struct bpf_map *map, const struct btf *btf, u32 btf_key_id, u32 btf_value_id)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
struct bpf_map * | map | |
const struct btf * | btf | |
u32 | btf_key_id | |
u32 | btf_value_id |
588 | ret = 0 |
591 | If btf_key_id Then |
592 | key_type = btf_type_id_size(btf, & btf_key_id, & key_size) |
595 | Else |
596 | key_type = btf_type_by_id(btf, 0) |
597 | If Not map_check_btf Then Return -EINVAL |
601 | value_type = btf_type_id_size(btf, & btf_value_id, & value_size) |
602 | If Not value_type || value_size != value_size Then Return -EINVAL |
607 | If map_value_has_spin_lock(map) Then |
608 | If map_flags & Flags for accessing BPF object from program side. Then Return -EACCES |
610 | If map_type != BPF_MAP_TYPE_HASH && map_type != BPF_MAP_TYPE_ARRAY && map_type != BPF_MAP_TYPE_CGROUP_STORAGE && map_type != BPF_MAP_TYPE_SK_STORAGE Then Return -Operation is not supported |
615 | If >=0 valid offset, <0 error + sizeof(structbpf_spin_lock) > value_size Then |
617 | WARN_ONCE(1, "verifier bug spin_lock_off %d value_size %d\n", >=0 valid offset, <0 error , value_size) |
620 | Return -EFAULT |
624 | If map_check_btf Then ret = map_check_btf(map, btf, key_type, value_type) |
627 | Return ret |
Name | Describe |
---|---|
map_create | alled via syscall |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |