函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:bpf_map_get_fd_by_id

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

返回类型:int

参数:

类型参数名称
const union bpf_attr *attr
2343  id等于map_id
2347  如果helper macro to check that unused fields 'union bpf_attr' are zero (BPF_MAP_GET_FD_BY_ID)或open_flags按位与BPF_OBJ_FLAG_MASK的反则返回:负EINVAL
2351  如果非操作权限检查则返回:负EPERM
2354  f_flags等于bpf_get_file_flag(open_flags)
2355  如果f_flags小于0则返回:f_flags
2358  spin_lock_bh( & map_idr_lock)
2359  map等于dr_find() - Return pointer for given ID
2360  如果mapmap等于map_idr_lock should have been held
2362  否则map等于错误号
2364  spin_unlock_bh( & map_idr_lock)
2366  如果是错误则返回:错误
2369  fd等于bpf_map_new_fd(map, f_flags)
2370  如果fd小于0则bpf_map_put_with_uref(map)
2373  返回:fd