Thread (45 messages) 45 messages, 7 authors, 2022-04-06
STALE1521d

[PATCH 01/18] bpf: Export bpf_link_inc()

From: Roberto Sassu <roberto.sassu@huawei.com>
Date: 2022-03-28 17:52:14
Also in: bpf, linux-arm-kernel, linux-doc, linux-fsdevel, linux-integrity, linux-kselftest, lkml, netdev
Subsystem: bpf [core], bpf [general] (safe dynamic programs and tools), the rest · Maintainers: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko, Eduard Zingerman, Kumar Kartikeya Dwivedi, Linus Torvalds

In the upcoming patches, populate_bpffs() will not have visibility anymore
on the links and maps to be pinned (to avoid the limitation of the 'objs'
fixed-size array), but the eBPF-program-specific preload method will
directly do the pinning and increase/decrease the reference count.

Since the preload method can be implemented in a kernel module, also
bpf_link_inc(), before called by populate_bpffs(), should be exported.
Thus, export bpf_link_inc().

Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
---
 kernel/bpf/syscall.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index cdaa1152436a..8ffe342545c3 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -2459,6 +2459,7 @@ void bpf_link_inc(struct bpf_link *link)
 {
 	atomic64_inc(&link->refcnt);
 }
+EXPORT_SYMBOL_GPL(bpf_link_inc);
 
 /* bpf_link_free is guaranteed to be called from process context */
 static void bpf_link_free(struct bpf_link *link)
-- 
2.32.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help