From e3ef728ff07b42668e7e12f49cd2f9055e064ec1 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Thu, 30 Mar 2023 10:05:31 -0600 Subject: io_uring: cap io_sqring_entries() at SQ ring size We already do this manually for the !SQPOLL case, do it in general and we can also dump the ugly min3() in io_submit_sqes(). Signed-off-by: Jens Axboe --- io_uring/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'io_uring/io_uring.c') diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 775b53730c2f..a0b64831c455 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -2434,7 +2434,7 @@ int io_submit_sqes(struct io_ring_ctx *ctx, unsigned int nr) if (unlikely(!entries)) return 0; /* make sure SQ entry isn't read before tail */ - ret = left = min3(nr, ctx->sq_entries, entries); + ret = left = min(nr, entries); io_get_task_refs(left); io_submit_state_start(&ctx->submit_state, left); -- cgit v1.2.3