public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: Caleb Sander Mateos <csander@purestorage.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: io-uring@vger.kernel.org, Caleb Sander Mateos <csander@purestorage.com>
Subject: [PATCH liburing] test: remove t_sqe_prep_cmd()
Date: Fri, 24 Oct 2025 10:16:36 -0600	[thread overview]
Message-ID: <20251024161636.3544162-1-csander@purestorage.com> (raw)

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


             reply	other threads:[~2025-10-24 16:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-24 16:16 Caleb Sander Mateos [this message]
2025-10-24 18:27 ` [PATCH liburing] test: remove t_sqe_prep_cmd() Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251024161636.3544162-1-csander@purestorage.com \
    --to=csander@purestorage.com \
    --cc=axboe@kernel.dk \
    --cc=io-uring@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox