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

Configure Feed

Select the types of activity you want to include in your feed.

selftests: ublk: specify io_cmd_buf pointer type

Matching the ublk driver, change the type of io_cmd_buf from char * to
struct ublksrv_io_desc *.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Acked-by: Shuah Khan <skhan@linuxfoundation.org>
Link: https://lore.kernel.org/r/20250328194230.2726862-3-csander@purestorage.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Caleb Sander Mateos and committed by
Jens Axboe
25aaa813 9a45714f

+3 -3
+1 -1
tools/testing/selftests/ublk/kublk.c
··· 322 322 323 323 cmd_buf_size = ublk_queue_cmd_buf_sz(q); 324 324 off = UBLKSRV_CMD_BUF_OFFSET + q->q_id * ublk_queue_max_cmd_buf_sz(); 325 - q->io_cmd_buf = (char *)mmap(0, cmd_buf_size, PROT_READ, 325 + q->io_cmd_buf = mmap(0, cmd_buf_size, PROT_READ, 326 326 MAP_SHARED | MAP_POPULATE, dev->fds[0], off); 327 327 if (q->io_cmd_buf == MAP_FAILED) { 328 328 ublk_err("ublk dev %d queue %d map io_cmd_buf failed %m\n",
+2 -2
tools/testing/selftests/ublk/kublk.h
··· 128 128 unsigned int io_inflight; 129 129 struct ublk_dev *dev; 130 130 const struct ublk_tgt_ops *tgt_ops; 131 - char *io_cmd_buf; 131 + struct ublksrv_io_desc *io_cmd_buf; 132 132 struct io_uring ring; 133 133 struct ublk_io ios[UBLK_QUEUE_DEPTH]; 134 134 #define UBLKSRV_QUEUE_STOPPING (1U << 0) ··· 302 302 303 303 static inline const struct ublksrv_io_desc *ublk_get_iod(const struct ublk_queue *q, int tag) 304 304 { 305 - return (struct ublksrv_io_desc *)&(q->io_cmd_buf[tag * sizeof(struct ublksrv_io_desc)]); 305 + return &q->io_cmd_buf[tag]; 306 306 } 307 307 308 308 static inline void ublk_set_sqe_cmd_op(struct io_uring_sqe *sqe, __u32 cmd_op)