Pull io_uring updates from Jens Axboe: "Here are the io_uring changes for this merge window. Light on new features this time around (just splice + buffer selection), lots of cleanups, fixes, and improvements to existing support. In particular, this contains: - Cleanup fixed file update handling for stack fallback (Hillf) - Re-work of how pollable async IO is handled, we no longer require thread offload to handle that. Instead we rely using poll to drive this, with task_work execution. - In conjunction with the above, allow expendable buffer selection, so that poll+recv (for example) no longer has to be a split operation. - Make sure we honor RLIMIT_FSIZE for buffered writes - Add support for splice (Pavel) - Linked work inheritance fixes and optimizations (Pavel) - Async work fixes and cleanups (Pavel) - Improve io-wq locking (Pavel) - Hashed link write improvements (Pavel) - SETUP_IOPOLL|SETUP_SQPOLL improvements (Xiaoguang)" * tag 'for-5.7/io_uring-2020-03-29' of git://git.kernel.dk/linux-block: (54 commits) io_uring: cleanup io_alloc_async_ctx() io_uring: fix missing 'return' in comment io-wq: handle hashed writes in chains io-uring: drop 'free_pfile' in struct io_file_put io-uring: drop completion when removing file io_uring: Fix ->data corruption on re-enqueue io-wq: close cancel gap for hashed linked work io_uring: make spdxcheck.py happy io_uring: honor original task RLIMIT_FSIZE io-wq: hash dependent work io-wq: split hashing and enqueueing io-wq: don't resched if there is no work io-wq: remove duplicated cancel code io_uring: fix truncated async read/readv and write/writev retry io_uring: dual license io_uring.h uapi header io_uring: io_uring_enter(2) don't poll while SETUP_IOPOLL|SETUP_SQPOLL enabled io_uring: Fix unused function warnings io_uring: add end-of-bits marker and build time verify it io_uring: provide means of removing buffers io_uring: add IOSQE_BUFFER_SELECT support for IORING_OP_RECVMSG ...
Showing the changes to include/uapi/linux (1 of 12 files). Show all
Unified · Split
| @@ -1,4 +1,4 @@ | ||
| 1 | −/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ | |
| 1 | +/* SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) OR MIT */ | |
| 2 | 2 | /* |
| 3 | 3 | * Header file for the io_uring interface. |
| 4 | 4 | * |
| @@ -23,7 +23,10 @@ struct io_uring_sqe { · 18 unmodified lines | ||
| 23 | 23 | __u64 off; /* offset into file */ |
| 24 | 24 | __u64 addr2; |
| 25 | 25 | }; |
| 26 | − __u64 addr; /* pointer to buffer or iovecs */ | |
| 26 | + union { | |
| 27 | + __u64 addr; /* pointer to buffer or iovecs */ | |
| 28 | + __u64 splice_off_in; | |
| 29 | + }; | |
| 27 | 30 | __u32 len; /* buffer size or number of iovecs */ |
| 28 | 31 | union { |
| 29 | 32 | __kernel_rwf_t rw_flags; |
| @@ -37,14 +40,21 @@ struct io_uring_sqe { · 7 unmodified lines | ||
| 37 | 40 | __u32 open_flags; |
| 38 | 41 | __u32 statx_flags; |
| 39 | 42 | __u32 fadvise_advice; |
| 43 | + __u32 splice_flags; | |
| 40 | 44 | }; |
| 41 | 45 | __u64 user_data; /* data to be passed back at completion time */ |
| 42 | 46 | union { |
| 43 | 47 | struct { |
| 44 | − /* index into fixed buffers, if used */ | |
| 45 | − __u16 buf_index; | |
| 48 | + /* pack this to avoid bogus arm OABI complaints */ | |
| 49 | + union { | |
| 50 | + /* index into fixed buffers, if used */ | |
| 51 | + __u16 buf_index; | |
| 52 | + /* for grouped buffer selection */ | |
| 53 | + __u16 buf_group; | |
| 54 | + } __attribute__((packed)); | |
| 46 | 55 | /* personality to use, if used */ |
| 47 | 56 | __u16 personality; |
| 57 | + __s32 splice_fd_in; | |
| 48 | 58 | }; |
| 49 | 59 | __u64 __pad2[3]; |
| 50 | 60 | }; |
| @@ -56,6 +66,7 @@ enum { · 5 unmodified lines | ||
| 56 | 66 | IOSQE_IO_LINK_BIT, |
| 57 | 67 | IOSQE_IO_HARDLINK_BIT, |
| 58 | 68 | IOSQE_ASYNC_BIT, |
| 69 | + IOSQE_BUFFER_SELECT_BIT, | |
| 59 | 70 | }; |
| 60 | 71 | |
| 61 | 72 | /* |
| @@ -71,6 +82,8 @@ enum { · 9 unmodified lines | ||
| 71 | 82 | #define IOSQE_IO_HARDLINK (1U << IOSQE_IO_HARDLINK_BIT) |
| 72 | 83 | /* always go async */ |
| 73 | 84 | #define IOSQE_ASYNC (1U << IOSQE_ASYNC_BIT) |
| 85 | +/* select buffer from sqe->buf_group */ | |
| 86 | +#define IOSQE_BUFFER_SELECT (1U << IOSQE_BUFFER_SELECT_BIT) | |
| 74 | 87 | |
| 75 | 88 | /* |
| 76 | 89 | * io_uring_setup() flags |
| @@ -113,6 +126,9 @@ enum { · 36 unmodified lines | ||
| 113 | 126 | IORING_OP_RECV, |
| 114 | 127 | IORING_OP_OPENAT2, |
| 115 | 128 | IORING_OP_EPOLL_CTL, |
| 129 | + IORING_OP_SPLICE, | |
| 130 | + IORING_OP_PROVIDE_BUFFERS, | |
| 131 | + IORING_OP_REMOVE_BUFFERS, | |
| 116 | 132 | |
| 117 | 133 | /* this goes last, obviously */ |
| 118 | 134 | IORING_OP_LAST, |
| @@ -128,6 +144,12 @@ enum { · 9 unmodified lines | ||
| 128 | 144 | */ |
| 129 | 145 | #define IORING_TIMEOUT_ABS (1U << 0) |
| 130 | 146 | |
| 147 | +/* | |
| 148 | + * sqe->splice_flags | |
| 149 | + * extends splice(2) flags | |
| 150 | + */ | |
| 151 | +#define SPLICE_F_FD_IN_FIXED (1U << 31) /* the last bit of __u32 */ | |
| 152 | + | |
| 131 | 153 | /* |
| 132 | 154 | * IO completion data structure (Completion Queue Entry) |
| 133 | 155 | */ |
| @@ -137,6 +159,17 @@ struct io_uring_cqe { · 3 unmodified lines | ||
| 137 | 159 | __u32 flags; |
| 138 | 160 | }; |
| 139 | 161 | |
| 162 | +/* | |
| 163 | + * cqe->flags | |
| 164 | + * | |
| 165 | + * IORING_CQE_F_BUFFER If set, the upper 16 bits are the buffer ID | |
| 166 | + */ | |
| 167 | +#define IORING_CQE_F_BUFFER (1U << 0) | |
| 168 | + | |
| 169 | +enum { | |
| 170 | + IORING_CQE_BUFFER_SHIFT = 16, | |
| 171 | +}; | |
| 172 | + | |
| 140 | 173 | /* |
| 141 | 174 | * Magic offsets for the application to mmap the data it needs |
| 142 | 175 | */ |
| @@ -204,6 +237,7 @@ struct io_uring_params { · 61 unmodified lines | ||
| 204 | 237 | #define IORING_FEAT_SUBMIT_STABLE (1U << 2) |
| 205 | 238 | #define IORING_FEAT_RW_CUR_POS (1U << 3) |
| 206 | 239 | #define IORING_FEAT_CUR_PERSONALITY (1U << 4) |
| 240 | +#define IORING_FEAT_FAST_POLL (1U << 5) | |
| 207 | 241 | |
| 208 | 242 | /* |
| 209 | 243 | * io_uring_register(2) opcodes and arguments |