[PATCH 4/7] engines/io_uring: simplify io_u_free

Vincent Fu <[email protected]> Fri, 25 Jul 2025 13:58:00 -0400
Newsgroups org.kernel.vger.fio
Message-ID <[email protected]>
Just free the buffer unconditionally. If the pointer is null nothing
will happen, so no harm is done.

This lets us also use this function for the io_uring ioengine when it
gains the ability to handle metadata which will happen in a subsequent
patch.

No functional change intended.

Signed-off-by: Vincent Fu <[email protected]>
---
 engines/io_uring.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/engines/io_uring.c b/engines/io_uring.c
index 231c47df..c054a98f 100644
--- a/engines/io_uring.c
+++ b/engines/io_uring.c
@@ -1468,14 +1468,10 @@ static int fio_ioring_io_u_cmd_init(struct thread_data *td, struct io_u *io_u)
 
 static void fio_ioring_io_u_free(struct thread_data *td, struct io_u *io_u)
 {
-	struct ioring_options *o = td->eo;
-
-	if (o->cmd_type == FIO_URING_CMD_NVME) {
-		struct nvme_pi *pi = io_u->engine_data;
+	struct nvme_pi *pi = io_u->engine_data;
 
-		free(pi);
-		io_u->engine_data = NULL;
-	}
+	free(pi);
+	io_u->engine_data = NULL;
 }
 
 static int fio_ioring_open_file(struct thread_data *td, struct fio_file *f)
-- 
2.47.2