History

io_uring: add IORING_REGISTER_RSRC

Add a new io_uring_register() opcode for rsrc registeration. Instead of accepting a pointer to resources, fds or iovecs, it @arg is now pointing to a struct io_uring_rsrc_register, and the second argument tells how large that struct is to make it easily extendible by adding new fields. All that is done mainly to be able to pass in a pointer with tags. Pass it in and enable CQE posting for file resources. Doesn't support setting tags on update yet. A design choice made here is to not post CQEs on rsrc de-registration, but only when we updated-removed it by rsrc dynamic update.

Pavel Begunkov committed 5 years ago

Commit 792e3581 parent fdecb662 files · +48 −5Browse files

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

Unified · Split

include/uapi/linux/io_uring.h+8−0
@@ -298,6 +298,7 @@ enum { · 297 unmodified lines
298298 IORING_UNREGISTER_PERSONALITY = 10,
299299 IORING_REGISTER_RESTRICTIONS = 11,
300300 IORING_REGISTER_ENABLE_RINGS = 12,
301+ IORING_REGISTER_RSRC = 13,
301302
302303 /* this goes last */
303304 IORING_REGISTER_LAST
@@ -320,6 +321,13 @@ enum { · 16 unmodified lines
320321 IORING_RSRC_FILE = 0,
321322 };
322323
324+struct io_uring_rsrc_register {
325+ __u32 type;
326+ __u32 nr;
327+ __aligned_u64 data;
328+ __aligned_u64 tags;
329+};
330+
323331 /* Skip updating fd indexes set to this value in the fd table */
324332 #define IORING_REGISTER_FILES_SKIP (-2)
325333