+static void fio_null_cleanup(struct thread_data *td)
+{
+ struct null_data *nd = td->io_ops->data;
+
+ if (nd) {
+ if (nd->io_us)
+ free(nd->io_us);
+ free(nd);
+ }
+}
+
+static int fio_null_init(struct thread_data *td)
+{
+ struct null_data *nd = malloc(sizeof(*nd));
+
+ memset(nd, 0, sizeof(*nd));
+
+ if (td->o.iodepth != 1) {
+ nd->io_us = malloc(td->o.iodepth * sizeof(struct io_u *));
+ memset(nd->io_us, 0, td->o.iodepth * sizeof(struct io_u *));
+ } else
+ td->io_ops->flags |= FIO_SYNCIO;
+
+ td->io_ops->data = nd;
+ return 0;
+}
+