History

io_uring: add generic rsrc update with tags

Add IORING_REGISTER_RSRC_UPDATE, which also supports passing in rsrc tags. Implement it for registered files.

Pavel Begunkov committed 5 years ago

Commit c3bdad01 parent 792e3582 files · +57 −17Browse files

Showing the changes to include/uapi (1 of 2 files). Show all

Unified · Split

include/uapi/linux/io_uring.h+16−6
@@ -299,6 +299,7 @@ enum { · 298 unmodified lines
299 IORING_REGISTER_RESTRICTIONS = 11,299 IORING_REGISTER_RESTRICTIONS = 11,
300 IORING_REGISTER_ENABLE_RINGS = 12,300 IORING_REGISTER_ENABLE_RINGS = 12,
301 IORING_REGISTER_RSRC = 13,301 IORING_REGISTER_RSRC = 13,
302 IORING_REGISTER_RSRC_UPDATE = 14,
302 303
303 /* this goes last */304 /* this goes last */
304 IORING_REGISTER_LAST305 IORING_REGISTER_LAST
@@ -311,12 +312,6 @@ struct io_uring_files_update { · 6 unmodified lines
311 __aligned_u64 /* __s32 * */ fds;312 __aligned_u64 /* __s32 * */ fds;
312};313};
313 314
314struct io_uring_rsrc_update {
315 __u32 offset;
316 __u32 resv;
317 __aligned_u64 data;
318};
319
320enum {315enum {
321 IORING_RSRC_FILE = 0,316 IORING_RSRC_FILE = 0,
322};317};
@@ -328,6 +323,21 @@ struct io_uring_rsrc_register { · 5 unmodified lines
328 __aligned_u64 tags;323 __aligned_u64 tags;
329};324};
330 325
326struct io_uring_rsrc_update {
327 __u32 offset;
328 __u32 resv;
329 __aligned_u64 data;
330};
331
332struct io_uring_rsrc_update2 {
333 __u32 offset;
334 __u32 resv;
335 __aligned_u64 data;
336 __aligned_u64 tags;
337 __u32 type;
338 __u32 nr;
339};
340
331/* Skip updating fd indexes set to this value in the fd table */341/* Skip updating fd indexes set to this value in the fd table */
332#define IORING_REGISTER_FILES_SKIP (-2)342#define IORING_REGISTER_FILES_SKIP (-2)
333 343