diff mbox series

[01/18] bpf: Export bpf_link_inc()

Message ID 20220328175033.2437312-2-roberto.sassu@huawei.com (mailing list archive)
State Changes Requested
Delegated to: BPF
Headers show
Series bpf: Secure and authenticated preloading of eBPF programs | expand

Checks

Context Check Description
bpf/vmtest-bpf-next-PR fail PR summary
netdev/tree_selection success Guessing tree name failed - patch did not apply, async

Commit Message

Roberto Sassu March 28, 2022, 5:50 p.m. UTC
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 mbox series

Patch

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)