summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2026-02-26 15:48:41 +0300
committerJens Axboe <axboe@kernel.dk>2026-03-17 01:15:00 +0300
commit98f37634b12b17ad5c56db8fb63cf9d7dc55d74c (patch)
treea8642a003b48dcf9cf91d541ff611df792c70dc2 /include/linux
parent890819248a8616558fe12e6c06c918ee1c3a2bc6 (diff)
downloadlinux-98f37634b12b17ad5c56db8fb63cf9d7dc55d74c.tar.xz
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>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/io_uring_types.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/io_uring_types.h b/include/linux/io_uring_types.h
index 344b634b8989..28e5dbdac55b 100644
--- a/include/linux/io_uring_types.h
+++ b/include/linux/io_uring_types.h
@@ -8,6 +8,9 @@
#include <linux/llist.h>
#include <uapi/linux/io_uring.h>
+struct iou_loop_params;
+struct io_uring_bpf_ops;
+
enum {
/*
* A hint to not wake right away but delay until there are enough of
@@ -488,6 +491,8 @@ struct io_ring_ctx {
DECLARE_HASHTABLE(napi_ht, 4);
#endif
+ struct io_uring_bpf_ops *bpf_ops;
+
/*
* Protection for resize vs mmap races - both the mmap and resize
* side will need to grab this lock, to prevent either side from