X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=ioengines.c;h=433da604ae4af03daf9fc8b8d5a81b2097ed0362;hb=c74cb68a1c13077222471e77f4715e0521cb4ed0;hp=bce65ea3a68c2b3887af924a17dffaafd512e483;hpb=bf0b7e75c1ccca4026c8880ed8a76fc7ef85f2f3;p=fio.git diff --git a/ioengines.c b/ioengines.c index bce65ea3..433da604 100644 --- a/ioengines.c +++ b/ioengines.c @@ -350,7 +350,7 @@ enum fio_q_status td_io_queue(struct thread_data *td, struct io_u *io_u) "invalid block size. Try setting direct=0.\n"); } - if (!td->io_ops->commit || io_u->ddir == DDIR_TRIM) { + if (!td->io_ops->commit) { io_u_mark_submit(td, 1); io_u_mark_complete(td, 1); } @@ -431,6 +431,14 @@ void td_io_commit(struct thread_data *td) int td_io_open_file(struct thread_data *td, struct fio_file *f) { + if (fio_file_closing(f)) { + /* + * Open translates to undo closing. + */ + fio_file_clear_closing(f); + get_file(f); + return 0; + } assert(!fio_file_open(f)); assert(f->fd == -1); assert(td->io_ops->open_file); @@ -540,11 +548,6 @@ int td_io_close_file(struct thread_data *td, struct fio_file *f) */ fio_file_set_closing(f); - disk_util_dec(f->du); - - if (td->o.file_lock_mode != FILE_LOCK_NONE) - unlock_file_all(td, f); - return put_file(td, f); }