Add support for fdatasync()
Adds a new option, fdatasync=. It's identical to the fsync= option,
but uses fdatasync() instead.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/log.c b/log.c
index 5014b48..c44d822 100644
--- a/log.c
+++ b/log.c
@@ -20,7 +20,7 @@
void log_io_u(struct thread_data *td, struct io_u *io_u)
{
- const char *act[] = { "read", "write", "sync" };
+ const char *act[] = { "read", "write", "sync", "datasync" };
assert(io_u->ddir < 3);
@@ -273,6 +273,8 @@
rw = DDIR_WRITE;
else if (!strcmp(act, "sync"))
rw = DDIR_SYNC;
+ else if (!strcmp(act, "datasync"))
+ rw = DDIR_DATASYNC;
else {
log_err("fio: bad iolog file action: %s\n",
act);
@@ -310,7 +312,7 @@
if (read_only)
continue;
writes++;
- } else if (rw != DDIR_SYNC && rw != DDIR_INVAL) {
+ } else if (!ddir_sync(rw)) {
log_err("bad ddir: %d\n", rw);
continue;
}