Command implementations shouldn't be directly looking into io_uring_cmd
to carve free space. Use an io_uring helper, which will also do build
time size sanitisation.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Reviewed-by: Kanchan Joshi <joshi.k@samsung.com>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Anuj Gupta <anuj20.g@samsung.com>
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Keith Busch <kbusch@kernel.org>
 static inline struct nvme_uring_cmd_pdu *nvme_uring_cmd_pdu(
                struct io_uring_cmd *ioucmd)
 {
-       return (struct nvme_uring_cmd_pdu *)&ioucmd->pdu;
+       return io_uring_cmd_to_pdu(ioucmd, struct nvme_uring_cmd_pdu);
 }
 
 static void nvme_uring_task_cb(struct io_uring_cmd *ioucmd,
        struct nvme_ctrl *ctrl = ns->ctrl;
        int ret;
 
-       BUILD_BUG_ON(sizeof(struct nvme_uring_cmd_pdu) > sizeof(ioucmd->pdu));
-
        ret = nvme_uring_cmd_checks(issue_flags);
        if (ret)
                return ret;