{
struct rbd_data *rbd;
- if (td->io_ops->data)
+ if (td->io_ops_data)
return 0;
rbd = calloc(1, sizeof(struct rbd_data));
return 0;
failed:
- if (rbd)
+ if (rbd) {
+ if (rbd->aio_events)
+ free(rbd->aio_events);
+ if (rbd->sort_events)
+ free(rbd->sort_events);
free(rbd);
+ }
return 1;
}
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