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.
Showing the changes to include/uapi (1 of 2 files). Show all
Unified · Split
| @@ -298,6 +298,7 @@ enum { · 297 unmodified lines | ||
| 298 | 298 | IORING_UNREGISTER_PERSONALITY = 10, |
| 299 | 299 | IORING_REGISTER_RESTRICTIONS = 11, |
| 300 | 300 | IORING_REGISTER_ENABLE_RINGS = 12, |
| 301 | + IORING_REGISTER_RSRC = 13, | |
| 301 | 302 | |
| 302 | 303 | /* this goes last */ |
| 303 | 304 | IORING_REGISTER_LAST |
| @@ -320,6 +321,13 @@ enum { · 16 unmodified lines | ||
| 320 | 321 | IORING_RSRC_FILE = 0, |
| 321 | 322 | }; |
| 322 | 323 | |
| 324 | +struct io_uring_rsrc_register { | |
| 325 | + __u32 type; | |
| 326 | + __u32 nr; | |
| 327 | + __aligned_u64 data; | |
| 328 | + __aligned_u64 tags; | |
| 329 | +}; | |
| 330 | + | |
| 323 | 331 | /* Skip updating fd indexes set to this value in the fd table */ |
| 324 | 332 | #define IORING_REGISTER_FILES_SKIP (-2) |
| 325 | 333 | |