X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=ioengines.c;h=1821916112cc13d3276d44fa6d14b11569b3d04c;hp=e5fbcd432ce78fb847148383ad03016966aab88d;hb=bd6b959a034cdcfcef010e56b139c609f56b83cf;hpb=a871240086ca6bdc52f79d7459ed283c5a359299 diff --git a/ioengines.c b/ioengines.c index e5fbcd43..18219161 100644 --- a/ioengines.c +++ b/ioengines.c @@ -319,6 +319,10 @@ enum fio_q_status td_io_queue(struct thread_data *td, struct io_u *io_u) } ret = td->io_ops->queue(td, io_u); + if (ret != FIO_Q_BUSY && io_u->post_submit) { + io_u->post_submit(io_u, io_u->error == 0); + io_u->post_submit = NULL; + } unlock_file(td, io_u->file); @@ -431,6 +435,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 +552,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); }