Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <ushankar@purestorage.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Caleb Sander Mateos <csander@purestorage.com>
Link: https://lore.kernel.org/r/20250327095123.179113-6-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Ming Lei and committed by
Jens Axboe
b460f328 1d781c0d

+1 -1
+1 -1
drivers/block/ublk_drv.c
··· 1040 1040 static inline struct ublk_uring_cmd_pdu *ublk_get_uring_cmd_pdu( 1041 1041 struct io_uring_cmd *ioucmd) 1042 1042 { 1043 - return (struct ublk_uring_cmd_pdu *)&ioucmd->pdu; 1043 + return io_uring_cmd_to_pdu(ioucmd, struct ublk_uring_cmd_pdu); 1044 1044 } 1045 1045 1046 1046 static inline bool ubq_daemon_is_dying(struct ublk_queue *ubq)