X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=ioengines.c;h=87db11ced12cf4c3b95408c82041ca3ee266ee7c;hp=bd2eb4a71ed899f2b7d3857d97ce87312b05aa2e;hb=4d4e80f2b4260f2c8b37a8612ce655502a799f7a;hpb=5f1348c709d91ffa54bde1a6a1beb53ecda613b7 diff --git a/ioengines.c b/ioengines.c index bd2eb4a7..87db11ce 100644 --- a/ioengines.c +++ b/ioengines.c @@ -168,14 +168,14 @@ int td_io_prep(struct thread_data *td, struct io_u *io_u) dprint_io_u(io_u, "prep"); fio_ro_check(td, io_u); - lock_file(td, io_u->file); + lock_file(td, io_u->file, io_u->ddir); if (td->io_ops->prep) { int ret = td->io_ops->prep(td, io_u); dprint(FD_IO, "->prep(%p)=%d\n", io_u, ret); if (ret) - unlock_file(io_u->file); + unlock_file(td, io_u->file); return ret; } @@ -232,7 +232,7 @@ int td_io_queue(struct thread_data *td, struct io_u *io_u) ret = td->io_ops->queue(td, io_u); - unlock_file(io_u->file); + unlock_file(td, io_u->file); if (ret != FIO_Q_BUSY) io_u_mark_depth(td, io_u); @@ -359,10 +359,7 @@ int td_io_close_file(struct thread_data *td, struct fio_file *f) */ f->flags |= FIO_FILE_CLOSING; - if (f->sem_owner == td && f->sem_batch) { - f->sem_batch = 0; - unlock_file(f); - } + unlock_file_all(td, f); return put_file(td, f); }