diff options
| author | Pavel Begunkov <asml.silence@gmail.com> | 2025-11-12 12:45:56 +0000 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2025-11-13 07:27:34 -0700 |
| commit | 0f4b537363cb66c78e97bb58c26986af62856356 (patch) | |
| tree | 4a71d99f705e158c91cc4c6b6d42e0cb59202f6b /io_uring/io_uring.h | |
| parent | 929dbbb699110c9377da721ed7b44a660bb4ee01 (diff) | |
io_uring: introduce struct io_ctx_config
There will be more information needed during ctx setup, and instead of
passing a handful of pointers around, wrap them all into a new
structure. Add a helper for encapsulating all configuration checks and
preparation, that's also reused for ring resizing.
Note, it indirectly adds a io_uring_sanitise_params() check to ring
resizing, which is a good thing.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/io_uring.h')
| -rw-r--r-- | io_uring/io_uring.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/io_uring/io_uring.h b/io_uring/io_uring.h index b2251446497a..d8bc44acb9fa 100644 --- a/io_uring/io_uring.h +++ b/io_uring/io_uring.h @@ -17,6 +17,11 @@ #include <trace/events/io_uring.h> #endif +struct io_ctx_config { + struct io_uring_params p; + struct io_uring_params __user *uptr; +}; + #define IORING_FEAT_FLAGS (IORING_FEAT_SINGLE_MMAP |\ IORING_FEAT_NODROP |\ IORING_FEAT_SUBMIT_STABLE |\ @@ -136,7 +141,8 @@ static inline bool io_should_wake(struct io_wait_queue *iowq) unsigned long rings_size(unsigned int flags, unsigned int sq_entries, unsigned int cq_entries, size_t *sq_offset); -int io_uring_fill_params(struct io_uring_params *p); +int io_prepare_config(struct io_ctx_config *config); + bool io_cqe_cache_refill(struct io_ring_ctx *ctx, bool overflow, bool cqe32); int io_run_task_work_sig(struct io_ring_ctx *ctx); int io_run_local_work(struct io_ring_ctx *ctx, int min_events, int max_events); |