X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=ioengines.c;h=9d7453bafcaef77ce32b64d76d99c5d033600555;hp=14b15ccd7468e6646a03b962095a97fb55cff74a;hb=da86ccb633a8eac058c7f1a74d2d74a073e51b41;hpb=eb7c8ae27bc301b77490b3586dd5ccab7c95880a diff --git a/ioengines.c b/ioengines.c index 14b15ccd..9d7453ba 100644 --- a/ioengines.c +++ b/ioengines.c @@ -77,16 +77,10 @@ static struct ioengine_ops *find_ioengine(const char *name) { 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; } @@ -201,6 +195,9 @@ int td_io_queue(struct thread_data *td, struct io_u *io_u) 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); @@ -260,3 +257,20 @@ int td_io_commit(struct thread_data *td) 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--; +}