| @@ -12,6 +12,10 @@ · 11 unmodified lines |
| 12 | #include <linux/types.h> | 12 | #include <linux/types.h> |
| 13 | #include <linux/time_types.h> | 13 | #include <linux/time_types.h> |
| 14 | | 14 | |
| | 15 | #ifdef __cplusplus |
| | 16 | extern "C" { |
| | 17 | #endif |
| | 18 | |
| 15 | /* | 19 | /* |
| 16 | * IO submission data structure (Submission Queue Entry) | 20 | * IO submission data structure (Submission Queue Entry) |
| 17 | */ | 21 | */ |
| @@ -67,8 +71,8 @@ struct io_uring_sqe { · 49 unmodified lines |
| 67 | __s32 splice_fd_in; | 71 | __s32 splice_fd_in; |
| 68 | __u32 file_index; | 72 | __u32 file_index; |
| 69 | struct { | 73 | struct { |
| 70 | __u16 notification_idx; | | |
| 71 | __u16 addr_len; | 74 | __u16 addr_len; |
| | 75 | __u16 __pad3[1]; |
| 72 | }; | 76 | }; |
| 73 | }; | 77 | }; |
| 74 | union { | 78 | union { |
| @@ -174,8 +178,7 @@ enum io_uring_op { · 99 unmodified lines |
| 174 | IORING_OP_FALLOCATE, | 178 | IORING_OP_FALLOCATE, |
| 175 | IORING_OP_OPENAT, | 179 | IORING_OP_OPENAT, |
| 176 | IORING_OP_CLOSE, | 180 | IORING_OP_CLOSE, |
| 177 | IORING_OP_RSRC_UPDATE, | 181 | IORING_OP_FILES_UPDATE, |
| 178 | IORING_OP_FILES_UPDATE = IORING_OP_RSRC_UPDATE, | | |
| 179 | IORING_OP_STATX, | 182 | IORING_OP_STATX, |
| 180 | IORING_OP_READ, | 183 | IORING_OP_READ, |
| 181 | IORING_OP_WRITE, | 184 | IORING_OP_WRITE, |
| @@ -202,7 +205,7 @@ enum io_uring_op { · 20 unmodified lines |
| 202 | IORING_OP_GETXATTR, | 205 | IORING_OP_GETXATTR, |
| 203 | IORING_OP_SOCKET, | 206 | IORING_OP_SOCKET, |
| 204 | IORING_OP_URING_CMD, | 207 | IORING_OP_URING_CMD, |
| 205 | IORING_OP_SENDZC_NOTIF, | 208 | IORING_OP_SEND_ZC, |
| 206 | | 209 | |
| 207 | /* this goes last, obviously */ | 210 | /* this goes last, obviously */ |
| 208 | IORING_OP_LAST, | 211 | IORING_OP_LAST, |
| @@ -224,7 +227,6 @@ enum io_uring_op { · 15 unmodified lines |
| 224 | #define IORING_TIMEOUT_ETIME_SUCCESS (1U << 5) | 227 | #define IORING_TIMEOUT_ETIME_SUCCESS (1U << 5) |
| 225 | #define IORING_TIMEOUT_CLOCK_MASK (IORING_TIMEOUT_BOOTTIME | IORING_TIMEOUT_REALTIME) | 228 | #define IORING_TIMEOUT_CLOCK_MASK (IORING_TIMEOUT_BOOTTIME | IORING_TIMEOUT_REALTIME) |
| 226 | #define IORING_TIMEOUT_UPDATE_MASK (IORING_TIMEOUT_UPDATE | IORING_LINK_TIMEOUT_UPDATE) | 229 | #define IORING_TIMEOUT_UPDATE_MASK (IORING_TIMEOUT_UPDATE | IORING_LINK_TIMEOUT_UPDATE) |
| 227 | | | |
| 228 | /* | 230 | /* |
| 229 | * sqe->splice_flags | 231 | * sqe->splice_flags |
| 230 | * extends splice(2) flags | 232 | * extends splice(2) flags |
| @@ -277,29 +279,16 @@ enum io_uring_op { · 46 unmodified lines |
| 277 | * | 279 | * |
| 278 | * IORING_RECVSEND_FIXED_BUF Use registered buffers, the index is stored in | 280 | * IORING_RECVSEND_FIXED_BUF Use registered buffers, the index is stored in |
| 279 | * the buf_index field. | 281 | * the buf_index field. |
| 280 | * | | |
| 281 | * IORING_RECVSEND_NOTIF_FLUSH Flush a notification after a successful | | |
| 282 | * successful. Only for zerocopy sends. | | |
| 283 | */ | 282 | */ |
| 284 | #define IORING_RECVSEND_POLL_FIRST (1U << 0) | 283 | #define IORING_RECVSEND_POLL_FIRST (1U << 0) |
| 285 | #define IORING_RECV_MULTISHOT (1U << 1) | 284 | #define IORING_RECV_MULTISHOT (1U << 1) |
| 286 | #define IORING_RECVSEND_FIXED_BUF (1U << 2) | 285 | #define IORING_RECVSEND_FIXED_BUF (1U << 2) |
| 287 | #define IORING_RECVSEND_NOTIF_FLUSH (1U << 3) | | |
| 288 | | 286 | |
| 289 | /* | 287 | /* |
| 290 | * accept flags stored in sqe->ioprio | 288 | * accept flags stored in sqe->ioprio |
| 291 | */ | 289 | */ |
| 292 | #define IORING_ACCEPT_MULTISHOT (1U << 0) | 290 | #define IORING_ACCEPT_MULTISHOT (1U << 0) |
| 293 | | 291 | |
| 294 | | | |
| 295 | /* | | |
| 296 | * IORING_OP_RSRC_UPDATE flags | | |
| 297 | */ | | |
| 298 | enum { | | |
| 299 | IORING_RSRC_UPDATE_FILES, | | |
| 300 | IORING_RSRC_UPDATE_NOTIF, | | |
| 301 | }; | | |
| 302 | | | |
| 303 | /* | 292 | /* |
| 304 | * IORING_OP_MSG_RING command types, stored in sqe->addr | 293 | * IORING_OP_MSG_RING command types, stored in sqe->addr |
| 305 | */ | 294 | */ |
| @@ -337,10 +326,13 @@ struct io_uring_cqe { · 31 unmodified lines |
| 337 | * IORING_CQE_F_BUFFER If set, the upper 16 bits are the buffer ID | 326 | * IORING_CQE_F_BUFFER If set, the upper 16 bits are the buffer ID |
| 338 | * IORING_CQE_F_MORE If set, parent SQE will generate more CQE entries | 327 | * IORING_CQE_F_MORE If set, parent SQE will generate more CQE entries |
| 339 | * IORING_CQE_F_SOCK_NONEMPTY If set, more data to read after socket recv | 328 | * IORING_CQE_F_SOCK_NONEMPTY If set, more data to read after socket recv |
| | 329 | * IORING_CQE_F_NOTIF Set for notification CQEs. Can be used to distinct |
| | 330 | * them from sends. |
| 340 | */ | 331 | */ |
| 341 | #define IORING_CQE_F_BUFFER (1U << 0) | 332 | #define IORING_CQE_F_BUFFER (1U << 0) |
| 342 | #define IORING_CQE_F_MORE (1U << 1) | 333 | #define IORING_CQE_F_MORE (1U << 1) |
| 343 | #define IORING_CQE_F_SOCK_NONEMPTY (1U << 2) | 334 | #define IORING_CQE_F_SOCK_NONEMPTY (1U << 2) |
| | 335 | #define IORING_CQE_F_NOTIF (1U << 3) |
| 344 | | 336 | |
| 345 | enum { | 337 | enum { |
| 346 | IORING_CQE_BUFFER_SHIFT = 16, | 338 | IORING_CQE_BUFFER_SHIFT = 16, |
| @@ -481,10 +473,6 @@ enum { · 134 unmodified lines |
| 481 | /* register a range of fixed file slots for automatic slot allocation */ | 473 | /* register a range of fixed file slots for automatic slot allocation */ |
| 482 | IORING_REGISTER_FILE_ALLOC_RANGE = 25, | 474 | IORING_REGISTER_FILE_ALLOC_RANGE = 25, |
| 483 | | 475 | |
| 484 | /* zerocopy notification API */ | | |
| 485 | IORING_REGISTER_NOTIFIERS = 26, | | |
| 486 | IORING_UNREGISTER_NOTIFIERS = 27, | | |
| 487 | | | |
| 488 | /* this goes last */ | 476 | /* this goes last */ |
| 489 | IORING_REGISTER_LAST | 477 | IORING_REGISTER_LAST |
| 490 | }; | 478 | }; |
| @@ -661,4 +649,8 @@ struct io_uring_recvmsg_out { · 170 unmodified lines |
| 661 | __u32 flags; | 649 | __u32 flags; |
| 662 | }; | 650 | }; |
| 663 | | 651 | |
| | 652 | #ifdef __cplusplus |
| | 653 | } |
| | 654 | #endif |
| | 655 | |
| 664 | #endif | 656 | #endif |