ioengines: Add thread_data to .errdetails
authorMinwoo Im <minwoo.im@samsung.com>
Thu, 15 Aug 2024 23:08:17 +0000 (08:08 +0900)
committerMinwoo Im <minwoo.im.dev@gmail.com>
Fri, 16 Aug 2024 12:07:40 +0000 (21:07 +0900)
No functional changes here, but added a 'struct thread_data *td' to the
errdetails callback.  This is a prep patch for the following commits to
access 'td->eo' instance from .errdetails callback.

Bump up FIO_IOOPS_VERSION to 36 since the previous commits updated
.errdetails callback for ioengines by adding 'thread_data' argument.

Signed-off-by: Minwoo Im <minwoo.im@samsung.com>
engines/librpma_fio.c
engines/librpma_fio.h
engines/sg.c
io_u.c
ioengines.h

index 42d6163ea19e1e14ae9c275bde19773a24b3fa03..4ccc6d0beee3b776f24577da614591e65d5f8d25 100644 (file)
@@ -790,7 +790,7 @@ struct io_u *librpma_fio_client_event(struct thread_data *td, int event)
        return io_u;
 }
 
-char *librpma_fio_client_errdetails(struct io_u *io_u)
+char *librpma_fio_client_errdetails(struct thread_data *td, struct io_u *io_u)
 {
        /* get the string representation of an error */
        enum ibv_wc_status status = io_u->error;
index 480ded1bde15b24f80209ae688cf49ee26e0d2d5..2bcbb3787619dc99e8f1aa177f15f4da05a94428 100644 (file)
@@ -162,7 +162,7 @@ int librpma_fio_client_getevents(struct thread_data *td, unsigned int min,
 
 struct io_u *librpma_fio_client_event(struct thread_data *td, int event);
 
-char *librpma_fio_client_errdetails(struct io_u *io_u);
+char *librpma_fio_client_errdetails(struct thread_data *td, struct io_u *io_u);
 
 static inline int librpma_fio_client_io_read(struct thread_data *td,
                struct io_u *io_u, int flags)
index 0bb5be4a9d64f6195a0165eee8f8e54e279f1ded..9df70bd28b75aefe8b7282cd2ec76bd54ecd64a7 100644 (file)
@@ -1154,7 +1154,7 @@ int fio_sgio_close(struct thread_data *td, struct fio_file *f)
  * Build an error string with details about the driver, host or scsi
  * error contained in the sg header Caller will use as necessary.
  */
-static char *fio_sgio_errdetails(struct io_u *io_u)
+static char *fio_sgio_errdetails(struct thread_data *td, struct io_u *io_u)
 {
        struct sg_io_hdr *hdr = &io_u->hdr;
 #define MAXERRDETAIL 1024
diff --git a/io_u.c b/io_u.c
index f81086b6582c2d10fe55bc5b2c5c422790e92ce6..40b0908237f1552ad38c2410659bc1bbaccb32f8 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -1963,7 +1963,7 @@ static void __io_u_log_error(struct thread_data *td, struct io_u *io_u)
        zbd_log_err(td, io_u);
 
        if (td->io_ops->errdetails) {
-               char *err = td->io_ops->errdetails(io_u);
+               char *err = td->io_ops->errdetails(td, io_u);
 
                log_err("fio: %s\n", err);
                free(err);
index 6039d41ef4de30a0245807c85bbbaffd278c7d77..b9834fec3ce4ca397c710b4f909c12f7de3a576e 100644 (file)
@@ -9,7 +9,7 @@
 #include "zbd_types.h"
 #include "dataplacement.h"
 
-#define FIO_IOOPS_VERSION      35
+#define FIO_IOOPS_VERSION      36
 
 #ifndef CONFIG_DYNAMIC_ENGINES
 #define FIO_STATIC     static
@@ -40,7 +40,7 @@ struct ioengine_ops {
        int (*commit)(struct thread_data *);
        int (*getevents)(struct thread_data *, unsigned int, unsigned int, const struct timespec *);
        struct io_u *(*event)(struct thread_data *, int);
-       char *(*errdetails)(struct io_u *);
+       char *(*errdetails)(struct thread_data *, struct io_u *);
        int (*cancel)(struct thread_data *, struct io_u *);
        void (*cleanup)(struct thread_data *);
        int (*open_file)(struct thread_data *, struct fio_file *);