t_sqe_prep_cmd() does the same thing as the recently added liburing function io_uring_prep_uring_cmd(). Switch to io_uring_prep_uring_cmd() to provide coverage of the real library function. Signed-off-by: Caleb Sander Mateos --- test/helpers.h | 7 ------- test/mock_file.c | 6 +++--- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/test/helpers.h b/test/helpers.h index cfada945..6317dcf2 100644 --- a/test/helpers.h +++ b/test/helpers.h @@ -127,17 +127,10 @@ int t_submit_and_wait_single(struct io_uring *ring, struct io_uring_cqe **cqe); size_t t_iovec_data_length(struct iovec *iov, unsigned iov_len); unsigned long t_compare_data_iovec(struct iovec *iov_src, unsigned nr_src, struct iovec *iov_dst, unsigned nr_dst); -static inline void t_sqe_prep_cmd(struct io_uring_sqe *sqe, - int fd, unsigned cmd_op) -{ - io_uring_prep_rw(IORING_OP_URING_CMD, sqe, fd, NULL, 0, 0); - sqe->cmd_op = cmd_op; -} - #ifdef __cplusplus } #endif #endif diff --git a/test/mock_file.c b/test/mock_file.c index 0614c09b..0f6460fc 100644 --- a/test/mock_file.c +++ b/test/mock_file.c @@ -44,11 +44,11 @@ static int setup_mgr(void) return T_EXIT_FAIL; } memset(&mp, 0, sizeof(mp)); sqe = io_uring_get_sqe(&mgr_ring); - t_sqe_prep_cmd(sqe, mgr_fd, IORING_MOCK_MGR_CMD_PROBE); + io_uring_prep_uring_cmd(sqe, IORING_MOCK_MGR_CMD_PROBE, mgr_fd); sqe->addr = (__u64)(unsigned long)∓ sqe->len = sizeof(mp); ret = t_submit_and_wait_single(&mgr_ring, &cqe); if (ret || cqe->res) { @@ -66,11 +66,11 @@ static int create_mock_file(struct io_uring_mock_create *mc) struct io_uring_cqe *cqe; struct io_uring_sqe *sqe; int ret; sqe = io_uring_get_sqe(&mgr_ring); - t_sqe_prep_cmd(sqe, mgr_fd, IORING_MOCK_MGR_CMD_CREATE); + io_uring_prep_uring_cmd(sqe, IORING_MOCK_MGR_CMD_CREATE, mgr_fd); sqe->addr = (__u64)(unsigned long)mc; sqe->len = sizeof(*mc); ret = t_submit_and_wait_single(&mgr_ring, &cqe); if (ret || cqe->res) { @@ -88,11 +88,11 @@ static int t_copy_regvec(struct io_uring *ring, int mock_fd, struct io_uring_cqe *cqe; struct io_uring_sqe *sqe; int ret; sqe = io_uring_get_sqe(ring); - t_sqe_prep_cmd(sqe, mock_fd, IORING_MOCK_CMD_COPY_REGBUF); + io_uring_prep_uring_cmd(sqe, IORING_MOCK_CMD_COPY_REGBUF, mock_fd); sqe->addr3 = (__u64)(unsigned long)buf; sqe->addr = (__u64)(unsigned long)iov; sqe->len = iov_len; if (from_iov) sqe->file_index = IORING_MOCK_COPY_FROM; -- 2.45.2