* Packs the information that we will need at completion time into the * sqe->user_data field, which is passed back in the completion in * cqe->user_data. Some apps would need more space than this, and in fact * I'd love to pack the requested IO size in here, and it's not uncommon to * see apps use this field as just a cookie to either index a data structure * at completion time, or even just
| 31 | * structure into this field. |
| 32 | */ |
| 33 | static inline void __encode_userdata(struct io_uring_sqe *sqe, int tid, int op, |
| 34 | int bid, int fd) |
| 35 | { |
| 36 | struct userdata ud = { |
| 37 | .op_tid = (op << OP_SHIFT) | tid, |
| 38 | .bid = bid, |
| 39 | .fd = fd |
| 40 | }; |
| 41 | |
| 42 | io_uring_sqe_set_data64(sqe, ud.val); |
| 43 | } |
| 44 | |
| 45 | static inline uint64_t __raw_encode(int tid, int op, int bid, int fd) |
| 46 | { |
no outgoing calls
no test coverage detected