Add file locking hooks
Does nothing so far, but adds locking calls that cover from ->prep()
to after ->queue(). That is the period where we do IO.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/ioengines.c b/ioengines.c
index 879c5f1..5a2d6b9 100644
--- a/ioengines.c
+++ b/ioengines.c
@@ -168,10 +168,14 @@
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 (ret)
+ unlock_file(io_u->file);
return ret;
}
@@ -228,6 +232,8 @@
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);