Add the file sharing bits
When you use the same filename for several jobs now, they will share
the same file structure. Enable locking through two new options:
- lockfile. If set, a semaphore is associated with the file and it is
held from ->prep() to ->queue() has done its work.
- lockfile_batch. This controls how many IOs the job gets to do per
semaphore acqusition.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/options.c b/options.c
index 1119a98..27b4fb6 100644
--- a/options.c
+++ b/options.c
@@ -385,6 +385,22 @@
.help = "File(s) to use for the workload",
},
{
+ .name = "lockfile",
+ .type = FIO_OPT_BOOL,
+ .off1 = td_var_offset(lockfile),
+ .help = "Lock file when doing IO to it",
+ .parent = "filename",
+ .def = "0",
+ },
+ {
+ .name = "lockfile_batch",
+ .type = FIO_OPT_INT,
+ .off1 = td_var_offset(lockfile_batch),
+ .help = "Number of IOs to allow per file lock",
+ .parent = "lockfile",
+ .def = "1",
+ },
+ {
.name = "opendir",
.type = FIO_OPT_STR_STORE,
.off1 = td_var_offset(opendir),