mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-11-01 09:13:37 +00:00
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>
This commit is contained in:
parent
9a45714fc5
commit
25aaa81371
2 changed files with 3 additions and 3 deletions
|
|
@ -322,7 +322,7 @@ static int ublk_queue_init(struct ublk_queue *q)
|
|||
|
||||
cmd_buf_size = ublk_queue_cmd_buf_sz(q);
|
||||
off = UBLKSRV_CMD_BUF_OFFSET + q->q_id * ublk_queue_max_cmd_buf_sz();
|
||||
q->io_cmd_buf = (char *)mmap(0, cmd_buf_size, PROT_READ,
|
||||
q->io_cmd_buf = mmap(0, cmd_buf_size, PROT_READ,
|
||||
MAP_SHARED | MAP_POPULATE, dev->fds[0], off);
|
||||
if (q->io_cmd_buf == MAP_FAILED) {
|
||||
ublk_err("ublk dev %d queue %d map io_cmd_buf failed %m\n",
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ struct ublk_queue {
|
|||
unsigned int io_inflight;
|
||||
struct ublk_dev *dev;
|
||||
const struct ublk_tgt_ops *tgt_ops;
|
||||
char *io_cmd_buf;
|
||||
struct ublksrv_io_desc *io_cmd_buf;
|
||||
struct io_uring ring;
|
||||
struct ublk_io ios[UBLK_QUEUE_DEPTH];
|
||||
#define UBLKSRV_QUEUE_STOPPING (1U << 0)
|
||||
|
|
@ -302,7 +302,7 @@ static inline void ublk_mark_io_done(struct ublk_io *io, int res)
|
|||
|
||||
static inline const struct ublksrv_io_desc *ublk_get_iod(const struct ublk_queue *q, int tag)
|
||||
{
|
||||
return (struct ublksrv_io_desc *)&(q->io_cmd_buf[tag * sizeof(struct ublksrv_io_desc)]);
|
||||
return &q->io_cmd_buf[tag];
|
||||
}
|
||||
|
||||
static inline void ublk_set_sqe_cmd_op(struct io_uring_sqe *sqe, __u32 cmd_op)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue