diff mbox series

[2/4] io_uring: use sizeof for io_issue_defs[IORING_OP_URING_CMD].async_size

Message ID 20241120160231.1106844-2-maharmstone@fb.com (mailing list archive)
State New
Headers show
Series [1/4] io_uring/cmd: rename struct uring_cache to io_uring_cmd_data | expand

Commit Message

Mark Harmstone Nov. 20, 2024, 4:02 p.m. UTC
Correct the value of io_issue_defs[IORING_OP_URING_CMD].async_size so
that it is derived from the size of the struct rather than being
calculated.

Signed-off-by: Mark Harmstone <maharmstone@fb.com>
---
 io_uring/opdef.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Jens Axboe Nov. 20, 2024, 4:49 p.m. UTC | #1
On 11/20/24 9:02 AM, Mark Harmstone wrote:
> Correct the value of io_issue_defs[IORING_OP_URING_CMD].async_size so
> that it is derived from the size of the struct rather than being
> calculated.

You should probably just fold this with patch 1, where the type is
changed.
diff mbox series

Patch

diff --git a/io_uring/opdef.c b/io_uring/opdef.c
index a2be3bbca5ff..c7746f67cc65 100644
--- a/io_uring/opdef.c
+++ b/io_uring/opdef.c
@@ -7,6 +7,7 @@ 
 #include <linux/fs.h>
 #include <linux/file.h>
 #include <linux/io_uring.h>
+#include <linux/io_uring/cmd.h>
 
 #include "io_uring.h"
 #include "opdef.h"
@@ -414,7 +415,7 @@  const struct io_issue_def io_issue_defs[] = {
 		.plug			= 1,
 		.iopoll			= 1,
 		.iopoll_queue		= 1,
-		.async_size		= 2 * sizeof(struct io_uring_sqe),
+		.async_size		= sizeof(struct io_uring_cmd_data),
 		.prep			= io_uring_cmd_prep,
 		.issue			= io_uring_cmd,
 	},