diff options
| author | Pavel Begunkov <asml.silence@gmail.com> | 2025-11-12 12:45:58 +0000 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2025-11-13 07:27:34 -0700 |
| commit | eb76ff6a6829a9a54a385804cc9dbe4460f156d6 (patch) | |
| tree | 397951b6fe2ca417a45a1ef1da03be3501ec0182 /io_uring/io_uring.h | |
| parent | 001b76b7e755767d847e9aebf1fd6e525f1e58c8 (diff) | |
io_uring: pre-calculate scq layout
Move ring layouts calculations into io_prepare_config(), so that more
misconfiguration checking can be done earlier before creating a ctx.
It also deduplicates some code with ring resizing. And as a bonus, now
it initialises params->sq_off.array, which is closer to all other user
offset init, and also applies it to ring resizing, which was previously
missing it.
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 | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/io_uring/io_uring.h b/io_uring/io_uring.h index 5e544c2d27c8..a790c16854d3 100644 --- a/io_uring/io_uring.h +++ b/io_uring/io_uring.h @@ -27,6 +27,7 @@ struct io_rings_layout { struct io_ctx_config { struct io_uring_params p; + struct io_rings_layout layout; struct io_uring_params __user *uptr; }; @@ -147,8 +148,6 @@ static inline bool io_should_wake(struct io_wait_queue *iowq) #define IORING_MAX_ENTRIES 32768 #define IORING_MAX_CQ_ENTRIES (2 * IORING_MAX_ENTRIES) -int rings_size(unsigned int flags, unsigned int sq_entries, - unsigned int cq_entries, struct io_rings_layout *rl); int io_prepare_config(struct io_ctx_config *config); bool io_cqe_cache_refill(struct io_ring_ctx *ctx, bool overflow, bool cqe32); |