projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
filehash.c: remove debug hash dump
[fio.git]
/
ioengines.c
diff --git
a/ioengines.c
b/ioengines.c
index 879c5f1c1f438a20a5116bec93968fc0d4e0642f..bd2eb4a71ed899f2b7d3857d97ce87312b05aa2e 100644
(file)
--- a/
ioengines.c
+++ b/
ioengines.c
@@
-168,10
+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);
dprint_io_u(io_u, "prep");
fio_ro_check(td, io_u);
+ lock_file(td, io_u->file);
+
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 (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);
return ret;
}
return ret;
}
@@
-228,6
+232,8
@@
int td_io_queue(struct thread_data *td, struct io_u *io_u)
ret = td->io_ops->queue(td, io_u);
ret = td->io_ops->queue(td, io_u);
+ unlock_file(io_u->file);
+
if (ret != FIO_Q_BUSY)
io_u_mark_depth(td, io_u);
if (ret != FIO_Q_BUSY)
io_u_mark_depth(td, io_u);
@@
-353,5
+359,10
@@
int td_io_close_file(struct thread_data *td, struct fio_file *f)
*/
f->flags |= FIO_FILE_CLOSING;
*/
f->flags |= FIO_FILE_CLOSING;
+ if (f->sem_owner == td && f->sem_batch) {
+ f->sem_batch = 0;
+ unlock_file(f);
+ }
+
return put_file(td, f);
}
return put_file(td, f);
}