函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:map_delete_elem

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

返回类型:int

参数:

类型参数名称
union bpf_attr *attr
1066  __userukey等于u64_to_user_ptr(key)
1067  ufd等于 anonymous struct used by BPF_MAP_*_ELEM commands
1073  如果helper macro to check that unused fields 'union bpf_attr' are zero (BPF_MAP_DELETE_ELEM)则返回:负EINVAL
1076  f等于fdget(ufd)
1077  map等于 error is returned, fd is released.* On success caller should complete fd access with matching fdput()
1078  如果是错误则返回:错误
1080  如果非map_get_sys_perms(map, f)按位与Has write method(s) 的值则
1081  err等于负EPERM
1082  转到:err_put
1085  key等于__bpf_copy_key(ukey, key_size)
1086  如果是错误
1087  err等于错误
1088  转到:err_put
1091  如果bpf_map_is_dev_bound(map)则
1092  err等于bpf_map_offload_delete_elem(map, key)
1093  转到:out
1094  否则如果IS_FD_PROG_ARRAY(map)则
1095  err等于map_delete_elem(map, key)
1096  转到:out
1099  禁止抢占()
1100  __this_cpu_inc(bpf_prog_active)
1101  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
1102  err等于map_delete_elem(map, key)
1103  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
1104  __this_cpu_dec(bpf_prog_active)
1105  禁用抢占和中断()
1106  maybe_wait_bpf_programs(map)
1107  out :
1108  kfree(key)
1109  err_put :
1110  fdput(f)
1111  返回:err