函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\bpf\syscall.c Create Date:2022-07-27 14:04:47
Last Modify:2022-05-19 18:06:12 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:alled via syscall

函数原型:static int map_create(union bpf_attr *attr)

返回类型:int

参数:

类型参数名称
union bpf_attr *attr
634  numa_node等于bpf_map_attr_numa_node(attr)
640  err等于helper macro to check that unused fields 'union bpf_attr' are zero (BPF_MAP_CREATE)
641  如果err则返回:负EINVAL
644  f_flags等于bpf_get_file_flag( BPF_MAP_CREATE related * flags defined above.)
645  如果f_flags小于0则返回:f_flags
648  如果numa_node不等于NUMA_NO_NODEnuma_node大于等于nr_node_ids或非NUMA节点状态(numa_node)的值则返回:负EINVAL
654  map等于find_and_alloc_map(attr)
655  如果是错误则返回:错误
658  err等于dst and src must have at least BPF_OBJ_NAME_LEN number of bytes.* Return 0 on success and < 0 on error.
659  如果err则转到:free_map
662  atomic64_set( & The 3rd and 4th cacheline with misc members to avoid false sharing * particularly with refcounting., 1)
663  atomic64_set( & usercnt, 1)
664  mutex_init - initialize the mutex*@mutex: the mutex to be initialized* Initialize the mutex to unlocked state.* It is not allowed to initialize an already locked mutex.( & freeze_mutex)
666  如果 BTF type_id of the key BTF type_id of the value
669  如果非 BTF type_id of the value
670  err等于负EINVAL
671  转到:free_map
674  btf等于btf_get_by_fd( fd pointing to a BTF type data )
675  如果是错误
676  err等于错误
677  转到:free_map
680  err等于map_check_btf(map, btf, BTF type_id of the key , BTF type_id of the value )
682  如果err
683  btf_put(btf)
684  转到:free_map
687  btf等于btf
688  btf_key_type_id等于 BTF type_id of the key
689  btf_value_type_id等于 BTF type_id of the value
690  否则
691  >=0 valid offset, <0 error 等于负EINVAL
694  err等于security_bpf_map_alloc(map)
695  如果err则转到:free_map
698  err等于bpf_map_alloc_id(map)
699  如果err则转到:free_map_sec
702  err等于bpf_map_new_fd(map, f_flags)
703  如果err小于0则
710  bpf_map_put_with_uref(map)
711  返回:err
714  返回:err
716  free_map_sec :
717  security_bpf_map_free(map)
718  free_map :
719  btf_put(btf)
720  bpf_map_charge_move( & mem, & memory)
721  map_free(map)
722  bpf_map_charge_finish( & mem)
723  返回:err