X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=ioengines.c;h=4c97d038630e05c8767907fbd09db1ac862f21f4;hb=8b5f73134cfaab8e3f72bea4166e57c59c635b69;hp=7840d2a86abb1447a3b5daeb7135ff225b275593;hpb=d6aed795f2e3e403828abf60874dd2d6e8342a1b;p=fio.git diff --git a/ioengines.c b/ioengines.c index 7840d2a8..4c97d038 100644 --- a/ioengines.c +++ b/ioengines.c @@ -17,6 +17,7 @@ #include #include "fio.h" +#include "diskutil.h" static FLIST_HEAD(engine_list); @@ -237,7 +238,7 @@ int td_io_queue(struct thread_data *td, struct io_u *io_u) sizeof(struct timeval)); } - if (io_u->ddir != DDIR_SYNC) + if (!ddir_sync(io_u->ddir)) td->io_issues[io_u->ddir]++; ret = td->io_ops->queue(td, io_u); @@ -250,14 +251,14 @@ int td_io_queue(struct thread_data *td, struct io_u *io_u) } if (ret == FIO_Q_COMPLETED) { - if (io_u->ddir != DDIR_SYNC) { + if (!ddir_sync(io_u->ddir)) { io_u_mark_depth(td, 1); td->ts.total_io_u[io_u->ddir]++; } } else if (ret == FIO_Q_QUEUED) { int r; - if (io_u->ddir != DDIR_SYNC) { + if (!ddir_sync(io_u->ddir)) { td->io_u_queued++; td->ts.total_io_u[io_u->ddir]++; } @@ -317,6 +318,9 @@ int td_io_commit(struct thread_data *td) int td_io_open_file(struct thread_data *td, struct fio_file *f) { + assert(!fio_file_open(f)); + assert(f->fd == -1); + if (td->io_ops->open_file(td, f)) { if (td->error == EINVAL && td->o.odirect) log_err("fio: destination does not support O_DIRECT\n"); @@ -326,6 +330,8 @@ int td_io_open_file(struct thread_data *td, struct fio_file *f) td->o.nr_files); } + assert(f->fd == -1); + assert(!fio_file_open(f)); return 1; } @@ -365,9 +371,6 @@ int td_io_open_file(struct thread_data *td, struct fio_file *f) } } - if (f->file_map) - memset(f->file_map, 0, f->num_maps * sizeof(int)); - #ifdef FIO_OS_DIRECTIO /* * Some OS's have a distinct call to mark the file non-buffered,