{
struct ioengine_ops *ops;
struct list_head *entry;
- char engine[16];
-
- strncpy(engine, name, sizeof(engine) - 1);
-
- if (!strncmp(engine, "linuxaio", 8) || !strncmp(engine, "aio", 3))
- strcpy(engine, "libaio");
list_for_each(entry, &engine_list) {
ops = list_entry(entry, struct ioengine_ops, list);
- if (!strcmp(engine, ops->name))
+ if (!strcmp(name, ops->name))
return ops;
}
assert((io_u->flags & IO_U_F_FLIGHT) == 0);
io_u->flags |= IO_U_F_FLIGHT;
+ io_u->error = 0;
+ io_u->resid = 0;
+
if (td->io_ops->flags & FIO_SYNCIO) {
fio_gettime(&io_u->issue_time, NULL);
return 0;
}
+
+int td_io_open_file(struct thread_data *td, struct fio_file *f)
+{
+ if (!td->io_ops->open_file(td, f)) {
+ td->nr_open_files++;
+ return 0;
+ }
+
+ return 1;
+}
+
+void td_io_close_file(struct thread_data *td, struct fio_file *f)
+{
+ if (td->io_ops->close_file)
+ td->io_ops->close_file(td, f);
+ td->nr_open_files--;
+}