diff options
author | Kui-Feng Lee <thinker.li@gmail.com> | 2024-05-29 23:59:42 -0700 |
---|---|---|
committer | Martin KaFai Lau <martin.lau@kernel.org> | 2024-05-30 15:34:13 -0700 |
commit | 67c3e8353f45c27800eecc46e00e8272f063f7d1 (patch) | |
tree | 93bf01e455328e537e1d9e441164be4264219ed2 /kernel/bpf/syscall.c | |
parent | 1adddc97aa44c8783f9f0276ea70854d56f9f6df (diff) | |
download | linux-67c3e8353f45c27800eecc46e00e8272f063f7d1.tar.gz linux-67c3e8353f45c27800eecc46e00e8272f063f7d1.tar.bz2 linux-67c3e8353f45c27800eecc46e00e8272f063f7d1.zip |
bpf: export bpf_link_inc_not_zero.
bpf_link_inc_not_zero() will be used by kernel modules. We will use it in
bpf_testmod.c later.
Signed-off-by: Kui-Feng Lee <thinker.li@gmail.com>
Link: https://lore.kernel.org/r/20240530065946.979330-5-thinker.li@gmail.com
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Diffstat (limited to 'kernel/bpf/syscall.c')
-rw-r--r-- | kernel/bpf/syscall.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c index 81efa1944942..5070fa20d05c 100644 --- a/kernel/bpf/syscall.c +++ b/kernel/bpf/syscall.c @@ -5437,10 +5437,11 @@ static int link_detach(union bpf_attr *attr) return ret; } -static struct bpf_link *bpf_link_inc_not_zero(struct bpf_link *link) +struct bpf_link *bpf_link_inc_not_zero(struct bpf_link *link) { return atomic64_fetch_add_unless(&link->refcnt, 1, 0) ? link : ERR_PTR(-ENOENT); } +EXPORT_SYMBOL(bpf_link_inc_not_zero); struct bpf_link *bpf_link_by_id(u32 id) { |