Skip to content

Commit

Permalink
ioengines: Add thread_data to .errdetails
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
minwooim committed Aug 16, 2024
1 parent 55b10cc commit 0c89abc
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion engines/librpma_fio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion engines/librpma_fio.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion engines/sg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion io_u.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions ioengines.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 *);
Expand Down

0 comments on commit 0c89abc

Please sign in to comment.