Skip to content

Commit b460f32

Browse files
Ming Leiaxboe
authored andcommitted
ublk: call io_uring_cmd_to_pdu to get uring_cmd pdu
Call io_uring_cmd_to_pdu() to get uring_cmd pdu, and one big benefit is the automatic pdu size build check. Suggested-by: Uday Shankar <[email protected]> Signed-off-by: Ming Lei <[email protected]> Reviewed-by: Caleb Sander Mateos <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 1d781c0 commit b460f32

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/block/ublk_drv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1040,7 +1040,7 @@ static blk_status_t ublk_setup_iod(struct ublk_queue *ubq, struct request *req)
10401040
static inline struct ublk_uring_cmd_pdu *ublk_get_uring_cmd_pdu(
10411041
struct io_uring_cmd *ioucmd)
10421042
{
1043-
return (struct ublk_uring_cmd_pdu *)&ioucmd->pdu;
1043+
return io_uring_cmd_to_pdu(ioucmd, struct ublk_uring_cmd_pdu);
10441044
}
10451045

10461046
static inline bool ubq_daemon_is_dying(struct ublk_queue *ubq)

0 commit comments

Comments
 (0)