Make sure we handle multiple arguments to sync_file_range
We need to be able to OR the values.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/ioengines.c b/ioengines.c
index 0e89534..de93497 100644
--- a/ioengines.c
+++ b/ioengines.c
@@ -439,8 +439,8 @@
offset = f->first_write;
nbytes = f->last_write - f->first_write;
- if (nbytes)
- return sync_file_range(f->fd, offset, nbytes, 0);
+ if (!nbytes)
+ return 0;
- return 0;
+ return sync_file_range(f->fd, offset, nbytes, td->o.sync_file_range);
}
diff --git a/options.c b/options.c
index bee15cf..dda7cba 100644
--- a/options.c
+++ b/options.c
@@ -1131,18 +1131,21 @@
{ .ival = "wait_before",
.oval = SYNC_FILE_RANGE_WAIT_BEFORE,
.help = "SYNC_FILE_RANGE_WAIT_BEFORE",
+ .or = 1,
},
{ .ival = "write",
.oval = SYNC_FILE_RANGE_WRITE,
.help = "SYNC_FILE_RANGE_WRITE",
+ .or = 1,
},
{
.ival = "wait_after",
.oval = SYNC_FILE_RANGE_WAIT_AFTER,
.help = "SYNC_FILE_RANGE_WAIT_AFTER",
+ .or = 1,
},
},
- .type = FIO_OPT_STR,
+ .type = FIO_OPT_STR_MULTI,
.cb = str_sfr_cb,
.off1 = td_var_offset(sync_file_range),
.help = "Use sync_file_range()",