}
}
-static int null_init(struct thread_data *td, struct null_data **nd_ptr)
+static struct null_data *null_init(struct thread_data *td)
{
- struct null_data *nd = (struct null_data *) malloc(sizeof(**nd_ptr));
+ struct null_data *nd = (struct null_data *) malloc(sizeof(*nd));
memset(nd, 0, sizeof(*nd));
} else
td->io_ops->flags |= FIO_SYNCIO;
- *nd_ptr = nd;
- return 0;
+ return nd;
}
#ifndef __cplusplus
static int fio_null_init(struct thread_data *td)
{
- return null_init(td, (struct null_data **)&td->io_ops_data);
+ td->io_ops_data = null_init(td);
+ assert(td->io_ops_data);
+ return 0;
}
static struct ioengine_ops ioengine = {
struct NullData {
NullData(struct thread_data *td)
{
- null_init(td, &impl_);
+ impl_ = null_init(td);
+ assert(impl_);
}
~NullData()