unsigned int max,
const struct timespec fio_unused *t)
{
- struct binject_data *bd = td->io_ops->data;
+ struct binject_data *bd = td->io_ops_data;
int left = max, ret, r = 0, ev_index = 0;
void *buf = bd->cmds;
unsigned int i, events;
static int fio_binject_prep(struct thread_data *td, struct io_u *io_u)
{
- struct binject_data *bd = td->io_ops->data;
+ struct binject_data *bd = td->io_ops_data;
struct b_user_cmd *buc = &io_u->buc;
struct binject_file *bf = FILE_ENG_DATA(io_u->file);
static struct io_u *fio_binject_event(struct thread_data *td, int event)
{
- struct binject_data *bd = td->io_ops->data;
+ struct binject_data *bd = td->io_ops_data;
return bd->events[event];
}
static void fio_binject_cleanup(struct thread_data *td)
{
- struct binject_data *bd = td->io_ops->data;
+ struct binject_data *bd = td->io_ops_data;
if (bd) {
free(bd->events);
bd->fd_flags = malloc(sizeof(int) * td->o.nr_files);
memset(bd->fd_flags, 0, sizeof(int) * td->o.nr_files);
- td->io_ops->data = bd;
+ td->io_ops_data = bd;
return 0;
}
goto err;
ed->bsz = stub.st_blksize;
- td->io_ops->data = ed;
+ td->io_ops_data = ed;
return 0;
err:
td_verror(td, errno, "io_queue_init");
static void fio_e4defrag_cleanup(struct thread_data *td)
{
- struct e4defrag_data *ed = td->io_ops->data;
+ struct e4defrag_data *ed = td->io_ops_data;
if (ed) {
if (ed->donor_fd >= 0)
close(ed->donor_fd);
unsigned long long len;
struct move_extent me;
struct fio_file *f = io_u->file;
- struct e4defrag_data *ed = td->io_ops->data;
+ struct e4defrag_data *ed = td->io_ops_data;
struct e4defrag_options *o = td->eo;
fio_ro_check(td, io_u);
dprint(FD_IO, "fio setup\n");
- if (td->io_ops->data)
+ if (td->io_ops_data)
return 0;
g = malloc(sizeof(struct gf_data));
goto cleanup;
}
dprint(FD_FILE, "fio setup %p\n", g->fs);
- td->io_ops->data = g;
+ td->io_ops_data = g;
return 0;
cleanup:
if (g->fs)
glfs_fini(g->fs);
free(g);
- td->io_ops->data = NULL;
+ td->io_ops_data = NULL;
return r;
}
void fio_gf_cleanup(struct thread_data *td)
{
- struct gf_data *g = td->io_ops->data;
+ struct gf_data *g = td->io_ops_data;
if (g) {
if (g->aio_events)
if (g->fs)
glfs_fini(g->fs);
free(g);
- td->io_ops->data = NULL;
+ td->io_ops_data = NULL;
}
}
{
struct stat buf;
int ret;
- struct gf_data *g = td->io_ops->data;
+ struct gf_data *g = td->io_ops_data;
dprint(FD_FILE, "get file size %s\n", f->file_name);
int flags = 0;
int ret = 0;
- struct gf_data *g = td->io_ops->data;
+ struct gf_data *g = td->io_ops_data;
struct stat sb = { 0, };
if (td_write(td)) {
int fio_gf_close_file(struct thread_data *td, struct fio_file *f)
{
int ret = 0;
- struct gf_data *g = td->io_ops->data;
+ struct gf_data *g = td->io_ops_data;
dprint(FD_FILE, "fd close %s\n", f->file_name);
int fio_gf_unlink_file(struct thread_data *td, struct fio_file *f)
{
int ret = 0;
- struct gf_data *g = td->io_ops->data;
+ struct gf_data *g = td->io_ops_data;
dprint(FD_FILE, "fd unlink %s\n", f->file_name);
g->fd = NULL;
free(g);
}
- td->io_ops->data = NULL;
+ td->io_ops_data = NULL;
return ret;
}
static struct io_u *fio_gf_event(struct thread_data *td, int event)
{
- struct gf_data *gf_data = td->io_ops->data;
+ struct gf_data *gf_data = td->io_ops_data;
dprint(FD_IO, "%s\n", __FUNCTION__);
return gf_data->aio_events[event];
static int fio_gf_getevents(struct thread_data *td, unsigned int min,
unsigned int max, const struct timespec *t)
{
- struct gf_data *g = td->io_ops->data;
+ struct gf_data *g = td->io_ops_data;
unsigned int events = 0;
struct io_u *io_u;
int i;
static int fio_gf_async_queue(struct thread_data fio_unused * td,
struct io_u *io_u)
{
- struct gf_data *g = td->io_ops->data;
+ struct gf_data *g = td->io_ops_data;
int r;
dprint(FD_IO, "%s op %s\n", __FUNCTION__, io_ddir_name(io_u->ddir));
return r;
td->o.use_thread = 1;
- g = td->io_ops->data;
+ g = td->io_ops_data;
g->aio_events = calloc(td->o.iodepth, sizeof(struct io_u *));
if (!g->aio_events) {
r = -ENOMEM;
static int fio_gf_prep(struct thread_data *td, struct io_u *io_u)
{
struct fio_file *f = io_u->file;
- struct gf_data *g = td->io_ops->data;
+ struct gf_data *g = td->io_ops_data;
dprint(FD_FILE, "fio prep\n");
static int fio_gf_queue(struct thread_data *td, struct io_u *io_u)
{
- struct gf_data *g = td->io_ops->data;
+ struct gf_data *g = td->io_ops_data;
int ret = 0;
dprint(FD_FILE, "fio queue len %lu\n", io_u->xfer_buflen);
static struct io_u *fio_guasi_event(struct thread_data *td, int event)
{
- struct guasi_data *ld = td->io_ops->data;
+ struct guasi_data *ld = td->io_ops_data;
struct io_u *io_u;
struct guasi_reqinfo rinf;
static int fio_guasi_getevents(struct thread_data *td, unsigned int min,
unsigned int max, const struct timespec *t)
{
- struct guasi_data *ld = td->io_ops->data;
+ struct guasi_data *ld = td->io_ops_data;
int n, r;
long timeo = -1;
static int fio_guasi_queue(struct thread_data *td, struct io_u *io_u)
{
- struct guasi_data *ld = td->io_ops->data;
+ struct guasi_data *ld = td->io_ops_data;
fio_ro_check(td, io_u);
static int fio_guasi_commit(struct thread_data *td)
{
- struct guasi_data *ld = td->io_ops->data;
+ struct guasi_data *ld = td->io_ops_data;
int i;
struct io_u *io_u;
struct fio_file *f;
static void fio_guasi_cleanup(struct thread_data *td)
{
- struct guasi_data *ld = td->io_ops->data;
+ struct guasi_data *ld = td->io_ops_data;
int n;
GDBG_PRINT(("fio_guasi_cleanup(%p)\n", ld));
ld->queued_nr = 0;
ld->reqs_nr = 0;
- td->io_ops->data = ld;
+ td->io_ops_data = ld;
GDBG_PRINT(("fio_guasi_init(): depth=%d -> %p\n", td->o.iodepth, ld));
return 0;
static struct io_u *fio_libaio_event(struct thread_data *td, int event)
{
- struct libaio_data *ld = td->io_ops->data;
+ struct libaio_data *ld = td->io_ops_data;
struct io_event *ev;
struct io_u *io_u;
static int fio_libaio_getevents(struct thread_data *td, unsigned int min,
unsigned int max, const struct timespec *t)
{
- struct libaio_data *ld = td->io_ops->data;
+ struct libaio_data *ld = td->io_ops_data;
struct libaio_options *o = td->eo;
unsigned actual_min = td->o.iodepth_batch_complete_min == 0 ? 0 : min;
struct timespec __lt, *lt = NULL;
static int fio_libaio_queue(struct thread_data *td, struct io_u *io_u)
{
- struct libaio_data *ld = td->io_ops->data;
+ struct libaio_data *ld = td->io_ops_data;
fio_ro_check(td, io_u);
static int fio_libaio_commit(struct thread_data *td)
{
- struct libaio_data *ld = td->io_ops->data;
+ struct libaio_data *ld = td->io_ops_data;
struct iocb **iocbs;
struct io_u **io_us;
struct timeval tv;
static int fio_libaio_cancel(struct thread_data *td, struct io_u *io_u)
{
- struct libaio_data *ld = td->io_ops->data;
+ struct libaio_data *ld = td->io_ops_data;
return io_cancel(ld->aio_ctx, &io_u->iocb, ld->aio_events);
}
static void fio_libaio_cleanup(struct thread_data *td)
{
- struct libaio_data *ld = td->io_ops->data;
+ struct libaio_data *ld = td->io_ops_data;
if (ld) {
/*
ld->iocbs = calloc(ld->entries, sizeof(struct iocb *));
ld->io_us = calloc(ld->entries, sizeof(struct io_u *));
- td->io_ops->data = ld;
+ td->io_ops_data = ld;
return 0;
}
static int fio_hdfsio_prep(struct thread_data *td, struct io_u *io_u)
{
struct hdfsio_options *options = td->eo;
- struct hdfsio_data *hd = td->io_ops->data;
+ struct hdfsio_data *hd = td->io_ops_data;
unsigned long f_id;
char fname[CHUNCK_NAME_LENGTH_MAX];
int open_flags;
static int fio_hdfsio_queue(struct thread_data *td, struct io_u *io_u)
{
- struct hdfsio_data *hd = td->io_ops->data;
+ struct hdfsio_data *hd = td->io_ops_data;
struct hdfsio_options *options = td->eo;
int ret;
unsigned long offset;
int fio_hdfsio_close_file(struct thread_data *td, struct fio_file *f)
{
- struct hdfsio_data *hd = td->io_ops->data;
+ struct hdfsio_data *hd = td->io_ops_data;
if (hd->curr_file_id != -1) {
if ( hdfsCloseFile(hd->fs, hd->fp) == -1) {
static int fio_hdfsio_init(struct thread_data *td)
{
struct hdfsio_options *options = td->eo;
- struct hdfsio_data *hd = td->io_ops->data;
+ struct hdfsio_data *hd = td->io_ops_data;
struct fio_file *f;
uint64_t j,k;
int i, failure = 0;
int i;
uint64_t file_size, total_file_size;
- if (!td->io_ops->data) {
+ if (!td->io_ops_data) {
hd = malloc(sizeof(*hd));
memset(hd, 0, sizeof(*hd));
hd->curr_file_id = -1;
- td->io_ops->data = hd;
+ td->io_ops_data = hd;
}
total_file_size = 0;
static int fio_hdfsio_io_u_init(struct thread_data *td, struct io_u *io_u)
{
- struct hdfsio_data *hd = td->io_ops->data;
+ struct hdfsio_data *hd = td->io_ops_data;
struct hdfsio_options *options = td->eo;
int failure;
struct hdfsBuilder *bld;
static void fio_hdfsio_io_u_free(struct thread_data *td, struct io_u *io_u)
{
- struct hdfsio_data *hd = td->io_ops->data;
+ struct hdfsio_data *hd = td->io_ops_data;
if (hd->fs && hdfsDisconnect(hd->fs) < 0) {
log_err("hdfs: disconnect failed: %d\n", errno);
*/
static int splice_in(struct thread_data *td, struct io_u *io_u)
{
- struct netio_data *nd = td->io_ops->data;
+ struct netio_data *nd = td->io_ops_data;
return splice_io_u(io_u->file->fd, nd->pipes[1], io_u->xfer_buflen);
}
static int splice_out(struct thread_data *td, struct io_u *io_u,
unsigned int len)
{
- struct netio_data *nd = td->io_ops->data;
+ struct netio_data *nd = td->io_ops_data;
return splice_io_u(nd->pipes[0], io_u->file->fd, len);
}
static int vmsplice_io_u_out(struct thread_data *td, struct io_u *io_u,
unsigned int len)
{
- struct netio_data *nd = td->io_ops->data;
+ struct netio_data *nd = td->io_ops_data;
return vmsplice_io_u(io_u, nd->pipes[0], len);
}
*/
static int vmsplice_io_u_in(struct thread_data *td, struct io_u *io_u)
{
- struct netio_data *nd = td->io_ops->data;
+ struct netio_data *nd = td->io_ops_data;
return vmsplice_io_u(io_u, nd->pipes[1], io_u->xfer_buflen);
}
static int fio_netio_send(struct thread_data *td, struct io_u *io_u)
{
- struct netio_data *nd = td->io_ops->data;
+ struct netio_data *nd = td->io_ops_data;
struct netio_options *o = td->eo;
int ret, flags = 0;
static int fio_netio_recv(struct thread_data *td, struct io_u *io_u)
{
- struct netio_data *nd = td->io_ops->data;
+ struct netio_data *nd = td->io_ops_data;
struct netio_options *o = td->eo;
int ret, flags = 0;
static int __fio_netio_queue(struct thread_data *td, struct io_u *io_u,
enum fio_ddir ddir)
{
- struct netio_data *nd = td->io_ops->data;
+ struct netio_data *nd = td->io_ops_data;
struct netio_options *o = td->eo;
int ret;
static int fio_netio_connect(struct thread_data *td, struct fio_file *f)
{
- struct netio_data *nd = td->io_ops->data;
+ struct netio_data *nd = td->io_ops_data;
struct netio_options *o = td->eo;
int type, domain;
static int fio_netio_accept(struct thread_data *td, struct fio_file *f)
{
- struct netio_data *nd = td->io_ops->data;
+ struct netio_data *nd = td->io_ops_data;
struct netio_options *o = td->eo;
socklen_t socklen;
int state;
static void fio_netio_send_close(struct thread_data *td, struct fio_file *f)
{
- struct netio_data *nd = td->io_ops->data;
+ struct netio_data *nd = td->io_ops_data;
struct netio_options *o = td->eo;
struct udp_close_msg msg;
struct sockaddr *to;
static int fio_netio_udp_recv_open(struct thread_data *td, struct fio_file *f)
{
- struct netio_data *nd = td->io_ops->data;
+ struct netio_data *nd = td->io_ops_data;
struct netio_options *o = td->eo;
struct udp_close_msg msg;
struct sockaddr *to;
static int fio_netio_send_open(struct thread_data *td, struct fio_file *f)
{
- struct netio_data *nd = td->io_ops->data;
+ struct netio_data *nd = td->io_ops_data;
struct netio_options *o = td->eo;
struct udp_close_msg msg;
struct sockaddr *to;
static int fio_netio_setup_connect_inet(struct thread_data *td,
const char *host, unsigned short port)
{
- struct netio_data *nd = td->io_ops->data;
+ struct netio_data *nd = td->io_ops_data;
struct netio_options *o = td->eo;
struct addrinfo *res = NULL;
void *dst, *src;
static int fio_netio_setup_connect_unix(struct thread_data *td,
const char *path)
{
- struct netio_data *nd = td->io_ops->data;
+ struct netio_data *nd = td->io_ops_data;
struct sockaddr_un *soun = &nd->addr_un;
soun->sun_family = AF_UNIX;
static int fio_netio_setup_listen_unix(struct thread_data *td, const char *path)
{
- struct netio_data *nd = td->io_ops->data;
+ struct netio_data *nd = td->io_ops_data;
struct sockaddr_un *addr = &nd->addr_un;
mode_t mode;
int len, fd;
static int fio_netio_setup_listen_inet(struct thread_data *td, short port)
{
- struct netio_data *nd = td->io_ops->data;
+ struct netio_data *nd = td->io_ops_data;
struct netio_options *o = td->eo;
struct ip_mreq mr;
struct sockaddr_in sin;
static int fio_netio_setup_listen(struct thread_data *td)
{
- struct netio_data *nd = td->io_ops->data;
+ struct netio_data *nd = td->io_ops_data;
struct netio_options *o = td->eo;
int ret;
static void fio_netio_cleanup(struct thread_data *td)
{
- struct netio_data *nd = td->io_ops->data;
+ struct netio_data *nd = td->io_ops_data;
if (nd) {
if (nd->listenfd != -1)
td->o.open_files++;
}
- if (!td->io_ops->data) {
+ if (!td->io_ops_data) {
nd = malloc(sizeof(*nd));;
memset(nd, 0, sizeof(*nd));
nd->listenfd = -1;
nd->pipes[0] = nd->pipes[1] = -1;
- td->io_ops->data = nd;
+ td->io_ops_data = nd;
}
return 0;
fio_netio_setup(td);
- nd = td->io_ops->data;
+ nd = td->io_ops_data;
if (nd) {
if (pipe(nd->pipes) < 0)
return 1;
static struct io_u *fio_null_event(struct thread_data *td, int event)
{
- struct null_data *nd = (struct null_data *) td->io_ops->data;
+ struct null_data *nd = (struct null_data *) td->io_ops_data;
return nd->io_us[event];
}
unsigned int fio_unused max,
const struct timespec fio_unused *t)
{
- struct null_data *nd = (struct null_data *) td->io_ops->data;
+ struct null_data *nd = (struct null_data *) td->io_ops_data;
int ret = 0;
if (min_events) {
static int fio_null_commit(struct thread_data *td)
{
- struct null_data *nd = (struct null_data *) td->io_ops->data;
+ struct null_data *nd = (struct null_data *) td->io_ops_data;
if (!nd->events) {
#ifndef FIO_EXTERNAL_ENGINE
static int fio_null_queue(struct thread_data *td, struct io_u *io_u)
{
- struct null_data *nd = (struct null_data *) td->io_ops->data;
+ struct null_data *nd = (struct null_data *) td->io_ops_data;
fio_ro_check(td, io_u);
static void fio_null_cleanup(struct thread_data *td)
{
- struct null_data *nd = (struct null_data *) td->io_ops->data;
+ struct null_data *nd = (struct null_data *) td->io_ops_data;
if (nd) {
free(nd->io_us);
} else
td->io_ops->flags |= FIO_SYNCIO;
- td->io_ops->data = nd;
+ td->io_ops_data = nd;
return 0;
}
static int fio_posixaio_getevents(struct thread_data *td, unsigned int min,
unsigned int max, const struct timespec *t)
{
- struct posixaio_data *pd = td->io_ops->data;
+ struct posixaio_data *pd = td->io_ops_data;
os_aiocb_t *suspend_list[SUSPEND_ENTRIES];
struct timespec start;
int have_timeout = 0;
static struct io_u *fio_posixaio_event(struct thread_data *td, int event)
{
- struct posixaio_data *pd = td->io_ops->data;
+ struct posixaio_data *pd = td->io_ops_data;
return pd->aio_events[event];
}
static int fio_posixaio_queue(struct thread_data *td,
struct io_u *io_u)
{
- struct posixaio_data *pd = td->io_ops->data;
+ struct posixaio_data *pd = td->io_ops_data;
os_aiocb_t *aiocb = &io_u->aiocb;
int ret;
static void fio_posixaio_cleanup(struct thread_data *td)
{
- struct posixaio_data *pd = td->io_ops->data;
+ struct posixaio_data *pd = td->io_ops_data;
if (pd) {
free(pd->aio_events);
pd->aio_events = malloc(td->o.iodepth * sizeof(struct io_u *));
memset(pd->aio_events, 0, td->o.iodepth * sizeof(struct io_u *));
- td->io_ops->data = pd;
+ td->io_ops_data = pd;
return 0;
}
{
struct rbd_data *rbd;
- if (td->io_ops->data)
+ if (td->io_ops_data)
return 0;
rbd = calloc(1, sizeof(struct rbd_data));
static int _fio_rbd_connect(struct thread_data *td)
{
- struct rbd_data *rbd = td->io_ops->data;
+ struct rbd_data *rbd = td->io_ops_data;
struct rbd_options *o = td->eo;
int r;
static struct io_u *fio_rbd_event(struct thread_data *td, int event)
{
- struct rbd_data *rbd = td->io_ops->data;
+ struct rbd_data *rbd = td->io_ops_data;
return rbd->aio_events[event];
}
static int rbd_iter_events(struct thread_data *td, unsigned int *events,
unsigned int min_evts, int wait)
{
- struct rbd_data *rbd = td->io_ops->data;
+ struct rbd_data *rbd = td->io_ops_data;
unsigned int this_events = 0;
struct io_u *io_u;
int i, sidx;
static int fio_rbd_queue(struct thread_data *td, struct io_u *io_u)
{
- struct rbd_data *rbd = td->io_ops->data;
+ struct rbd_data *rbd = td->io_ops_data;
struct fio_rbd_iou *fri = io_u->engine_data;
int r = -1;
static void fio_rbd_cleanup(struct thread_data *td)
{
- struct rbd_data *rbd = td->io_ops->data;
+ struct rbd_data *rbd = td->io_ops_data;
if (rbd) {
_fio_rbd_disconnect(rbd);
log_err("fio_setup_rbd_data failed.\n");
goto cleanup;
}
- td->io_ops->data = rbd;
+ td->io_ops_data = rbd;
/* librbd does not allow us to run first in the main thread and later
* in a fork child. It needs to be the same process context all the
static int fio_rbd_invalidate(struct thread_data *td, struct fio_file *f)
{
#if defined(CONFIG_RBD_INVAL)
- struct rbd_data *rbd = td->io_ops->data;
+ struct rbd_data *rbd = td->io_ops_data;
return rbd_invalidate_cache(rbd->image);
#else
static int client_recv(struct thread_data *td, struct ibv_wc *wc)
{
- struct rdmaio_data *rd = td->io_ops->data;
+ struct rdmaio_data *rd = td->io_ops_data;
unsigned int max_bs;
if (wc->byte_len != sizeof(rd->recv_buf)) {
static int server_recv(struct thread_data *td, struct ibv_wc *wc)
{
- struct rdmaio_data *rd = td->io_ops->data;
+ struct rdmaio_data *rd = td->io_ops_data;
unsigned int max_bs;
if (wc->wr_id == FIO_RDMA_MAX_IO_DEPTH) {
static int cq_event_handler(struct thread_data *td, enum ibv_wc_opcode opcode)
{
- struct rdmaio_data *rd = td->io_ops->data;
+ struct rdmaio_data *rd = td->io_ops_data;
struct ibv_wc wc;
struct rdma_io_u_data *r_io_u_d;
int ret;
*/
static int rdma_poll_wait(struct thread_data *td, enum ibv_wc_opcode opcode)
{
- struct rdmaio_data *rd = td->io_ops->data;
+ struct rdmaio_data *rd = td->io_ops_data;
struct ibv_cq *ev_cq;
void *ev_ctx;
int ret;
static int fio_rdmaio_setup_qp(struct thread_data *td)
{
- struct rdmaio_data *rd = td->io_ops->data;
+ struct rdmaio_data *rd = td->io_ops_data;
struct ibv_qp_init_attr init_attr;
int qp_depth = td->o.iodepth * 2; /* 2 times of io depth */
static int fio_rdmaio_setup_control_msg_buffers(struct thread_data *td)
{
- struct rdmaio_data *rd = td->io_ops->data;
+ struct rdmaio_data *rd = td->io_ops_data;
rd->recv_mr = ibv_reg_mr(rd->pd, &rd->recv_buf, sizeof(rd->recv_buf),
IBV_ACCESS_LOCAL_WRITE);
struct rdma_event_channel *channel,
enum rdma_cm_event_type wait_event)
{
- struct rdmaio_data *rd = td->io_ops->data;
+ struct rdmaio_data *rd = td->io_ops_data;
struct rdma_cm_event *event;
int ret;
static int fio_rdmaio_prep(struct thread_data *td, struct io_u *io_u)
{
- struct rdmaio_data *rd = td->io_ops->data;
+ struct rdmaio_data *rd = td->io_ops_data;
struct rdma_io_u_data *r_io_u_d;
r_io_u_d = io_u->engine_data;
static struct io_u *fio_rdmaio_event(struct thread_data *td, int event)
{
- struct rdmaio_data *rd = td->io_ops->data;
+ struct rdmaio_data *rd = td->io_ops_data;
struct io_u *io_u;
int i;
static int fio_rdmaio_getevents(struct thread_data *td, unsigned int min,
unsigned int max, const struct timespec *t)
{
- struct rdmaio_data *rd = td->io_ops->data;
+ struct rdmaio_data *rd = td->io_ops_data;
enum ibv_wc_opcode comp_opcode;
struct ibv_cq *ev_cq;
void *ev_ctx;
static int fio_rdmaio_send(struct thread_data *td, struct io_u **io_us,
unsigned int nr)
{
- struct rdmaio_data *rd = td->io_ops->data;
+ struct rdmaio_data *rd = td->io_ops_data;
struct ibv_send_wr *bad_wr;
#if 0
enum ibv_wc_opcode comp_opcode;
static int fio_rdmaio_recv(struct thread_data *td, struct io_u **io_us,
unsigned int nr)
{
- struct rdmaio_data *rd = td->io_ops->data;
+ struct rdmaio_data *rd = td->io_ops_data;
struct ibv_recv_wr *bad_wr;
struct rdma_io_u_data *r_io_u_d;
int i;
static int fio_rdmaio_queue(struct thread_data *td, struct io_u *io_u)
{
- struct rdmaio_data *rd = td->io_ops->data;
+ struct rdmaio_data *rd = td->io_ops_data;
fio_ro_check(td, io_u);
static void fio_rdmaio_queued(struct thread_data *td, struct io_u **io_us,
unsigned int nr)
{
- struct rdmaio_data *rd = td->io_ops->data;
+ struct rdmaio_data *rd = td->io_ops_data;
struct timeval now;
unsigned int i;
static int fio_rdmaio_commit(struct thread_data *td)
{
- struct rdmaio_data *rd = td->io_ops->data;
+ struct rdmaio_data *rd = td->io_ops_data;
struct io_u **io_us;
int ret;
static int fio_rdmaio_connect(struct thread_data *td, struct fio_file *f)
{
- struct rdmaio_data *rd = td->io_ops->data;
+ struct rdmaio_data *rd = td->io_ops_data;
struct rdma_conn_param conn_param;
struct ibv_send_wr *bad_wr;
static int fio_rdmaio_accept(struct thread_data *td, struct fio_file *f)
{
- struct rdmaio_data *rd = td->io_ops->data;
+ struct rdmaio_data *rd = td->io_ops_data;
struct rdma_conn_param conn_param;
struct ibv_send_wr *bad_wr;
int ret = 0;
static int fio_rdmaio_close_file(struct thread_data *td, struct fio_file *f)
{
- struct rdmaio_data *rd = td->io_ops->data;
+ struct rdmaio_data *rd = td->io_ops_data;
struct ibv_send_wr *bad_wr;
/* unregister rdma buffer */
static int fio_rdmaio_setup_connect(struct thread_data *td, const char *host,
unsigned short port)
{
- struct rdmaio_data *rd = td->io_ops->data;
+ struct rdmaio_data *rd = td->io_ops_data;
struct ibv_recv_wr *bad_wr;
int err;
static int fio_rdmaio_setup_listen(struct thread_data *td, short port)
{
- struct rdmaio_data *rd = td->io_ops->data;
+ struct rdmaio_data *rd = td->io_ops_data;
struct ibv_recv_wr *bad_wr;
int state = td->runstate;
static int fio_rdmaio_init(struct thread_data *td)
{
- struct rdmaio_data *rd = td->io_ops->data;
+ struct rdmaio_data *rd = td->io_ops_data;
struct rdmaio_options *o = td->eo;
unsigned int max_bs;
int ret, i;
static void fio_rdmaio_cleanup(struct thread_data *td)
{
- struct rdmaio_data *rd = td->io_ops->data;
+ struct rdmaio_data *rd = td->io_ops_data;
if (rd)
free(rd);
td->o.open_files++;
}
- if (!td->io_ops->data) {
+ if (!td->io_ops_data) {
rd = malloc(sizeof(*rd));
memset(rd, 0, sizeof(*rd));
init_rand_seed(&rd->rand_state, (unsigned int) GOLDEN_RATIO_PRIME, 0);
- td->io_ops->data = rd;
+ td->io_ops_data = rd;
}
return 0;
unsigned int max,
const struct timespec fio_unused *t)
{
- struct sgio_data *sd = td->io_ops->data;
+ struct sgio_data *sd = td->io_ops_data;
int left = max, eventNum, ret, r = 0;
void *buf = sd->sgbuf;
unsigned int i, events;
static int fio_sgio_ioctl_doio(struct thread_data *td,
struct fio_file *f, struct io_u *io_u)
{
- struct sgio_data *sd = td->io_ops->data;
+ struct sgio_data *sd = td->io_ops_data;
struct sg_io_hdr *hdr = &io_u->hdr;
int ret;
static int fio_sgio_prep(struct thread_data *td, struct io_u *io_u)
{
struct sg_io_hdr *hdr = &io_u->hdr;
- struct sgio_data *sd = td->io_ops->data;
+ struct sgio_data *sd = td->io_ops_data;
long long nr_blocks, lba;
if (io_u->xfer_buflen & (sd->bs - 1)) {
static struct io_u *fio_sgio_event(struct thread_data *td, int event)
{
- struct sgio_data *sd = td->io_ops->data;
+ struct sgio_data *sd = td->io_ops_data;
return sd->events[event];
}
static void fio_sgio_cleanup(struct thread_data *td)
{
- struct sgio_data *sd = td->io_ops->data;
+ struct sgio_data *sd = td->io_ops_data;
if (sd) {
free(sd->events);
sd->sgbuf = malloc(sizeof(struct sg_io_hdr) * td->o.iodepth);
memset(sd->sgbuf, 0, sizeof(struct sg_io_hdr) * td->o.iodepth);
sd->type_checked = 0;
- td->io_ops->data = sd;
+ td->io_ops_data = sd;
/*
* we want to do it, regardless of whether odirect is set or not
static int fio_sgio_type_check(struct thread_data *td, struct fio_file *f)
{
- struct sgio_data *sd = td->io_ops->data;
+ struct sgio_data *sd = td->io_ops_data;
unsigned int bs = 0;
unsigned long long max_lba = 0;
static int fio_sgio_open(struct thread_data *td, struct fio_file *f)
{
- struct sgio_data *sd = td->io_ops->data;
+ struct sgio_data *sd = td->io_ops_data;
int ret;
ret = generic_open_file(td, f);
static int fio_solarisaio_prep(struct thread_data fio_unused *td,
struct io_u *io_u)
{
- struct solarisaio_data *sd = td->io_ops->data;
+ struct solarisaio_data *sd = td->io_ops_data;
io_u->resultp.aio_return = AIO_INPROGRESS;
io_u->engine_data = sd;
static int fio_solarisaio_getevents(struct thread_data *td, unsigned int min,
unsigned int max, const struct timespec *t)
{
- struct solarisaio_data *sd = td->io_ops->data;
+ struct solarisaio_data *sd = td->io_ops_data;
struct timeval tv;
int ret;
static struct io_u *fio_solarisaio_event(struct thread_data *td, int event)
{
- struct solarisaio_data *sd = td->io_ops->data;
+ struct solarisaio_data *sd = td->io_ops_data;
return sd->aio_events[event];
}
static int fio_solarisaio_queue(struct thread_data fio_unused *td,
struct io_u *io_u)
{
- struct solarisaio_data *sd = td->io_ops->data;
+ struct solarisaio_data *sd = td->io_ops_data;
struct fio_file *f = io_u->file;
off_t off;
int ret;
static void fio_solarisaio_cleanup(struct thread_data *td)
{
- struct solarisaio_data *sd = td->io_ops->data;
+ struct solarisaio_data *sd = td->io_ops_data;
if (sd) {
free(sd->aio_events);
fio_solarisaio_init_sigio();
#endif
- td->io_ops->data = sd;
+ td->io_ops_data = sd;
return 0;
}
*/
static int fio_splice_read_old(struct thread_data *td, struct io_u *io_u)
{
- struct spliceio_data *sd = td->io_ops->data;
+ struct spliceio_data *sd = td->io_ops_data;
struct fio_file *f = io_u->file;
int ret, ret2, buflen;
off_t offset;
*/
static int fio_splice_read(struct thread_data *td, struct io_u *io_u)
{
- struct spliceio_data *sd = td->io_ops->data;
+ struct spliceio_data *sd = td->io_ops_data;
struct fio_file *f = io_u->file;
struct iovec iov;
int ret , buflen, mmap_len;
*/
static int fio_splice_write(struct thread_data *td, struct io_u *io_u)
{
- struct spliceio_data *sd = td->io_ops->data;
+ struct spliceio_data *sd = td->io_ops_data;
struct iovec iov = {
.iov_base = io_u->xfer_buf,
.iov_len = io_u->xfer_buflen,
static int fio_spliceio_queue(struct thread_data *td, struct io_u *io_u)
{
- struct spliceio_data *sd = td->io_ops->data;
+ struct spliceio_data *sd = td->io_ops_data;
int ret = 0;
fio_ro_check(td, io_u);
static void fio_spliceio_cleanup(struct thread_data *td)
{
- struct spliceio_data *sd = td->io_ops->data;
+ struct spliceio_data *sd = td->io_ops_data;
if (sd) {
close(sd->pipe[0]);
if (td_read(td))
td->o.mem_align = 1;
- td->io_ops->data = sd;
+ td->io_ops_data = sd;
return 0;
}
#ifdef CONFIG_PWRITEV
static int fio_pvsyncio_queue(struct thread_data *td, struct io_u *io_u)
{
- struct syncio_data *sd = td->io_ops->data;
+ struct syncio_data *sd = td->io_ops_data;
struct iovec *iov = &sd->iovecs[0];
struct fio_file *f = io_u->file;
int ret;
#ifdef FIO_HAVE_PWRITEV2
static int fio_pvsyncio2_queue(struct thread_data *td, struct io_u *io_u)
{
- struct syncio_data *sd = td->io_ops->data;
+ struct syncio_data *sd = td->io_ops_data;
struct psyncv2_options *o = td->eo;
struct iovec *iov = &sd->iovecs[0];
struct fio_file *f = io_u->file;
unsigned int max,
const struct timespec fio_unused *t)
{
- struct syncio_data *sd = td->io_ops->data;
+ struct syncio_data *sd = td->io_ops_data;
int ret;
if (min) {
static struct io_u *fio_vsyncio_event(struct thread_data *td, int event)
{
- struct syncio_data *sd = td->io_ops->data;
+ struct syncio_data *sd = td->io_ops_data;
return sd->io_us[event];
}
static int fio_vsyncio_append(struct thread_data *td, struct io_u *io_u)
{
- struct syncio_data *sd = td->io_ops->data;
+ struct syncio_data *sd = td->io_ops_data;
if (ddir_sync(io_u->ddir))
return 0;
static int fio_vsyncio_queue(struct thread_data *td, struct io_u *io_u)
{
- struct syncio_data *sd = td->io_ops->data;
+ struct syncio_data *sd = td->io_ops_data;
fio_ro_check(td, io_u);
*/
static int fio_vsyncio_end(struct thread_data *td, ssize_t bytes)
{
- struct syncio_data *sd = td->io_ops->data;
+ struct syncio_data *sd = td->io_ops_data;
struct io_u *io_u;
unsigned int i;
int err;
static int fio_vsyncio_commit(struct thread_data *td)
{
- struct syncio_data *sd = td->io_ops->data;
+ struct syncio_data *sd = td->io_ops_data;
struct fio_file *f;
ssize_t ret;
sd->iovecs = malloc(td->o.iodepth * sizeof(struct iovec));
sd->io_us = malloc(td->o.iodepth * sizeof(struct io_u *));
- td->io_ops->data = sd;
+ td->io_ops_data = sd;
return 0;
}
static void fio_vsyncio_cleanup(struct thread_data *td)
{
- struct syncio_data *sd = td->io_ops->data;
+ struct syncio_data *sd = td->io_ops_data;
if (sd) {
free(sd->iovecs);
}
}
- td->io_ops->data = wd;
+ td->io_ops_data = wd;
if (!rc) {
struct thread_ctx *ctx;
rc = 1;
}
- wd = td->io_ops->data;
+ wd = td->io_ops_data;
wd->iothread_running = TRUE;
wd->iocp = hFile;
{
struct windowsaio_data *wd;
- wd = td->io_ops->data;
+ wd = td->io_ops_data;
if (wd != NULL) {
wd->iothread_running = FALSE;
free(wd->aio_events);
free(wd);
- td->io_ops->data = NULL;
+ td->io_ops_data = NULL;
}
}
/* Only set up the completion port and thread if we're not just
* querying the device size */
- if (!rc && td->io_ops->data != NULL) {
+ if (!rc && td->io_ops_data != NULL) {
struct windowsaio_data *wd;
- wd = td->io_ops->data;
+ wd = td->io_ops_data;
if (CreateIoCompletionPort(f->hFile, wd->iocp, 0, 0) == NULL) {
log_err("windowsaio: failed to create io completion port\n");
static struct io_u* fio_windowsaio_event(struct thread_data *td, int event)
{
- struct windowsaio_data *wd = td->io_ops->data;
+ struct windowsaio_data *wd = td->io_ops_data;
return wd->aio_events[event];
}
unsigned int max,
const struct timespec *t)
{
- struct windowsaio_data *wd = td->io_ops->data;
+ struct windowsaio_data *wd = td->io_ops_data;
unsigned int dequeued = 0;
struct io_u *io_u;
int i;
*/
struct ioengine_ops *io_ops;
+ /*
+ * IO engine private data and dlhandle.
+ */
+ void *io_ops_data;
+ void *io_ops_dlhandle;
+
/*
* Queue depth of io_u's that fio MIGHT do
*/
void (*io_u_free)(struct thread_data *, struct io_u *);
int option_struct_size;
struct fio_option *options;
- void *data;
- void *dlhandle;
};
enum fio_ioengine_flags {
return NULL;
}
- ops->dlhandle = dlhandle;
+ td->io_ops_dlhandle = dlhandle;
return ops;
}
struct ioengine_ops *load_ioengine(struct thread_data *td, const char *name)
{
- struct ioengine_ops *ops, *ret;
+ struct ioengine_ops *ops;
char engine[16];
dprint(FD_IO, "load ioengine %s\n", name);
if (check_engine_ops(ops))
return NULL;
- ret = malloc(sizeof(*ret));
- memcpy(ret, ops, sizeof(*ret));
- ret->data = NULL;
-
- return ret;
+ return ops;
}
/*
td->eo = NULL;
}
- if (td->io_ops->dlhandle)
- dlclose(td->io_ops->dlhandle);
+ if (td->io_ops_dlhandle)
+ dlclose(td->io_ops_dlhandle);
- free(td->io_ops);
td->io_ops = NULL;
}
if (td->io_ops->cleanup) {
td->io_ops->cleanup(td);
- td->io_ops->data = NULL;
+ td->io_ops_data = NULL;
}
free_ioengine(td);