@@ -33,7 +33,11 @@ struct io_uring_cmd {
};
u32 cmd_op;
u32 flags;
- u8 pdu[32]; /* available inline for free use */
+ union {
+ /* driver needs to save ctx_id */
+ u32 ctx_id;
+ u8 pdu[32]; /* available inline for free use */
+ };
};
static inline const void *io_uring_sqe_cmd(const struct io_uring_sqe *sqe)
@@ -105,6 +105,7 @@ int io_uring_cmd_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
req->imu = ctx->user_bufs[index];
io_req_set_rsrc_node(req, ctx, 0);
}
+ ioucmd->ctx_id = req->ctx->id;
ioucmd->sqe = sqe;
ioucmd->cmd_op = READ_ONCE(sqe->cmd_op);
return 0;
Pass io_uring_ctx-id to uring_cmd driver, and prepare for supporting io_uring ctx or task exit notifier. Signed-off-by: Ming Lei <ming.lei@redhat.com> --- include/linux/io_uring.h | 6 +++++- io_uring/uring_cmd.c | 1 + 2 files changed, 6 insertions(+), 1 deletion(-)