return FIO_Q_COMPLETED;
}
-static int fio_cpuio_setup(struct thread_data fio_unused *td)
-{
- struct fio_file *f;
- unsigned int i;
-
- for_each_file(td, f, i) {
- if (td->o.size)
- f->real_file_size = td->o.size / td->o.nr_files;
- else
- f->real_file_size = -1ULL;
- }
-
- return 0;
-}
-
static int fio_cpuio_init(struct thread_data *td)
{
struct thread_options *o = &td->o;
.version = FIO_IOOPS_VERSION,
.queue = fio_cpuio_queue,
.init = fio_cpuio_init,
- .setup = fio_cpuio_setup,
.open_file = fio_cpuio_open,
.flags = FIO_SYNCIO | FIO_DISKLESSIO,
};
static int fio_netio_setup(struct thread_data *td)
{
struct netio_data *nd;
- struct fio_file *f;
- unsigned int i;
if (!td->io_ops->data) {
nd = malloc(sizeof(*nd));;
memset(nd, 0, sizeof(*nd));
nd->listenfd = -1;
td->io_ops->data = nd;
-
- for_each_file(td, f, i) {
- if (td->o.size)
- f->real_file_size = td->o.size / td->o.nr_files;
- else
- f->real_file_size = -1ULL;
- }
}
return 0;
return FIO_Q_QUEUED;
}
-static int fio_null_setup(struct thread_data *td)
-{
- struct fio_file *f;
- unsigned int i;
-
- for_each_file(td, f, i) {
- if (td->o.size)
- f->real_file_size = td->o.size / td->o.nr_files;
- else
- f->real_file_size = -1ULL;
- }
-
- return 0;
-}
-
static int fio_null_open(struct thread_data fio_unused *td,
struct fio_file fio_unused *f)
{
static struct ioengine_ops ioengine = {
.name = "null",
.version = FIO_IOOPS_VERSION,
- .setup = fio_null_setup,
.queue = fio_null_queue,
.commit = fio_null_commit,
.getevents = fio_null_getevents,
err = 1;
}
clear_error(td);
- } else
- td->io_ops->close_file(td, f);
+ } else {
+ if (td->io_ops->close_file)
+ td->io_ops->close_file(td, f);
+ }
if (f->real_file_size == -1ULL && td->o.size)
f->real_file_size = td->o.size / td->o.nr_files;
memset(f, 0, sizeof(*f));
f->fd = -1;
+ /*
+ * init function, io engine may not be loaded yet
+ */
+ if (td->io_ops && (td->io_ops->flags & FIO_DISKLESSIO))
+ f->real_file_size = -1ULL;
+
if (td->o.directory)
len = sprintf(file_name, "%s/", td->o.directory);
if (fixup_options(td))
goto err;
+ if (td->io_ops->flags & FIO_DISKLESSIO) {
+ struct fio_file *f;
+
+ for_each_file(td, f, i)
+ f->real_file_size = -1ULL;
+ }
+
td->mutex = fio_sem_init(0);
td->ts.clat_stat[0].min_val = td->ts.clat_stat[1].min_val = ULONG_MAX;