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
299299 IORING_REGISTER_RESTRICTIONS = 11,
300300 IORING_REGISTER_ENABLE_RINGS = 12,
301301 IORING_REGISTER_RSRC = 13,
302+ IORING_REGISTER_RSRC_UPDATE = 14,
302303
303304 /* this goes last */
304305 IORING_REGISTER_LAST
@@ -311,12 +312,6 @@ struct io_uring_files_update { · 6 unmodified lines
311312 __aligned_u64 /* __s32 * */ fds;
312313 };
313314
314−struct io_uring_rsrc_update {
315− __u32 offset;
316− __u32 resv;
317− __aligned_u64 data;
318−};
319−
320315 enum {
321316 IORING_RSRC_FILE = 0,
322317 };
@@ -328,6 +323,21 @@ struct io_uring_rsrc_register { · 5 unmodified lines
328323 __aligned_u64 tags;
329324 };
330325
326+struct io_uring_rsrc_update {
327+ __u32 offset;
328+ __u32 resv;
329+ __aligned_u64 data;
330+};
331+
332+struct 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+
331341 /* Skip updating fd indexes set to this value in the fd table */
332342 #define IORING_REGISTER_FILES_SKIP (-2)
333343