File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
tools/testing/selftests/ublk Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -322,7 +322,7 @@ static int ublk_queue_init(struct ublk_queue *q)
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" ,
Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ struct ublk_queue {
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,7 +302,7 @@ static inline void ublk_mark_io_done(struct ublk_io *io, int res)
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 )
You can’t perform that action at this time.
0 commit comments