We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6746ee4 commit a6ccb48Copy full SHA for a6ccb48
include/linux/io_uring/cmd.h
@@ -23,6 +23,15 @@ static inline const void *io_uring_sqe_cmd(const struct io_uring_sqe *sqe)
23
return sqe->cmd;
24
}
25
26
+static inline void io_uring_cmd_private_sz_check(size_t cmd_sz)
27
+{
28
+ BUILD_BUG_ON(cmd_sz > sizeof_field(struct io_uring_cmd, pdu));
29
+}
30
+#define io_uring_cmd_to_pdu(cmd, pdu_type) ( \
31
+ io_uring_cmd_private_sz_check(sizeof(pdu_type)), \
32
+ ((pdu_type *)&(cmd)->pdu) \
33
+)
34
+
35
#if defined(CONFIG_IO_URING)
36
int io_uring_cmd_import_fixed(u64 ubuf, unsigned long len, int rw,
37
struct iov_iter *iter, void *ioucmd);
0 commit comments