From 0c89abc1368936b9de836b77ab87e91a1ef5a7f8 Mon Sep 17 00:00:00 2001 From: Minwoo Im Date: Fri, 16 Aug 2024 08:08:17 +0900 Subject: [PATCH] ioengines: Add thread_data to .errdetails 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 --- engines/librpma_fio.c | 2 +- engines/librpma_fio.h | 2 +- engines/sg.c | 2 +- io_u.c | 2 +- ioengines.h | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/engines/librpma_fio.c b/engines/librpma_fio.c index 42d6163ea1..4ccc6d0bee 100644 --- a/engines/librpma_fio.c +++ b/engines/librpma_fio.c @@ -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; diff --git a/engines/librpma_fio.h b/engines/librpma_fio.h index 480ded1bde..2bcbb37876 100644 --- a/engines/librpma_fio.h +++ b/engines/librpma_fio.h @@ -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) diff --git a/engines/sg.c b/engines/sg.c index 0bb5be4a9d..9df70bd28b 100644 --- a/engines/sg.c +++ b/engines/sg.c @@ -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 f81086b658..40b0908237 100644 --- 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); diff --git a/ioengines.h b/ioengines.h index 6039d41ef4..b9834fec3c 100644 --- a/ioengines.h +++ b/ioengines.h @@ -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 *);