]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
bpf: Export necessary symbols for modules with struct_ops
authorD. Wythe <alibuda@linux.alibaba.com>
Fri, 7 Nov 2025 03:56:30 +0000 (11:56 +0800)
committerMartin KaFai Lau <martin.lau@kernel.org>
Mon, 10 Nov 2025 19:07:34 +0000 (11:07 -0800)
commit07c428ece3222832bdbfcc4ffa8b8d3991c5eb39
tree2333601a0f0469d49f3395ebd6366dcd1a1cd3f2
parentabd0c0f6aabc4f60e711ea8e7de40bdda17654c5
bpf: Export necessary symbols for modules with struct_ops

Exports three necessary symbols for implementing struct_ops with
tristate subsystem.

To hold or release refcnt of struct_ops refcnt by inline funcs
bpf_try_module_get and bpf_module_put which use bpf_struct_ops_get(put)
conditionally.

And to copy obj name from one to the other with effective checks by
bpf_obj_name_cpy.

Signed-off-by: D. Wythe <alibuda@linux.alibaba.com>
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://patch.msgid.link/20251107035632.115950-2-alibuda@linux.alibaba.com
kernel/bpf/bpf_struct_ops.c
kernel/bpf/syscall.c