Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\bpf\syscall.c Create Date:2022-07-28 12:54:09
Last Modify:2022-05-19 18:06:12 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:bpf_prog_get_fd_by_id

Proto:static int bpf_prog_get_fd_by_id(const union bpf_attr *attr)

Type:int

Parameter:

TypeParameterName
const union bpf_attr *attr
2311  id = prog_id
2314  If helper macro to check that unused fields 'union bpf_attr' are zero (BPF_PROG_GET_FD_BY_ID) Then Return -EINVAL
2317  If Not Check operation authority Then Return -EPERM
2320  spin_lock_bh( & prog_idr_lock)
2321  prog = dr_find() - Return pointer for given ID
2322  If prog Then prog = prog_idr_lock should have been held
2324  Else prog = ERR_PTR( - ENOENT)
2326  spin_unlock_bh( & prog_idr_lock)
2328  If IS_ERR(prog) Then Return PTR_ERR(prog)
2331  fd = bpf_prog_new_fd(prog)
2332  If fd < 0 Then bpf_prog_put(prog)
2335  Return fd