io_uring/bpf-ops: implement bpf ops registration
authorPavel Begunkov <asml.silence@gmail.com>
Thu, 26 Feb 2026 12:48:41 +0000 (12:48 +0000)
committerJens Axboe <axboe@kernel.dk>
Mon, 16 Mar 2026 22:15:00 +0000 (16:15 -0600)
commit98f37634b12b17ad5c56db8fb63cf9d7dc55d74c
treea8642a003b48dcf9cf91d541ff611df792c70dc2
parent890819248a8616558fe12e6c06c918ee1c3a2bc6
io_uring/bpf-ops: implement bpf ops registration

Implement BPF struct ops registration. It's registered off the BPF
path, and can be removed by BPF as well as io_uring. To protect it,
introduce a global lock synchronising registration. ctx->uring_lock can
be nested under it. ctx->bpf_ops is write protected by both locks and
so it's safe to read it under either of them.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://patch.msgid.link/1f46bffd76008de49cbafa2ad77d348810a4f69e.1772109579.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/linux/io_uring_types.h
io_uring/bpf-ops.c
io_uring/bpf-ops.h
io_uring/io_uring.c