public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH liburing] test: remove t_sqe_prep_cmd()
@ 2025-10-24 16:16 Caleb Sander Mateos
  2025-10-24 18:27 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Caleb Sander Mateos @ 2025-10-24 16:16 UTC (permalink / raw)
  To: Jens Axboe; +Cc: io-uring, Caleb Sander Mateos

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 <csander@purestorage.com>
---
 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)&mp;
 	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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-10-24 18:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-24 16:16 [PATCH liburing] test: remove t_sqe_prep_cmd() Caleb Sander Mateos
2025-10-24 18:27 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox