Add documentation for 'sync_file_range'
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/HOWTO b/HOWTO
index 886515b..6c7f05b 100644
--- a/HOWTO
+++ b/HOWTO
@@ -566,11 +566,25 @@
not sync the file. The exception is the sg io engine, which
synchronizes the disk cache anyway.
-fsyncdata=int Like fsync= but uses fdatasync() to only sync data and not
+fdatasync=int Like fsync= but uses fdatasync() to only sync data and not
metadata blocks.
In FreeBSD there is no fdatasync(), this falls back to
using fsync()
+sync_file_range=str:val Use sync_file_range() for every 'val' number of
+ write operations. Fio will track range of writes that
+ have happened since the last sync_file_range() call. 'str'
+ can currently be one or more of:
+
+ wait_before SYNC_FILE_RANGE_WAIT_BEFORE
+ write SYNC_FILE_RANGE_WRITE
+ wait_after SYNC_FILE_RANGE_WAIT_AFTER
+
+ So if you do sync_file_range=wait_before,write:8, fio would
+ use SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE for
+ every 8 writes. Also see the sync_file_range(2) man page.
+ This option is Linux specific.
+
overwrite=bool If true, writes to a file will always overwrite existing
data. If the file doesn't already exist, it will be
created before the write phase begins. If the file exists
diff --git a/fio.1 b/fio.1
index 60f787a..5d0988b 100644
--- a/fio.1
+++ b/fio.1
@@ -380,6 +380,27 @@
Like \fBfsync\fR, but uses \fBfdatasync\fR\|(2) instead to only sync the
data parts of the file. Default: 0.
.TP
+.BI sync_file_range \fR=\fPstr:int
+Use sync_file_range() for every \fRval\fP number of write operations. Fio will
+track range of writes that have happened since the last sync_file_range() call.
+\fRstr\fP can currently be one or more of:
+.RS
+.TP
+.B wait_before
+SYNC_FILE_RANGE_WAIT_BEFORE
+.TP
+.B write
+SYNC_FILE_RANGE_WRITE
+.TP
+.B wait_after
+SYNC_FILE_RANGE_WRITE
+.TP
+.RE
+.P
+So if you do sync_file_range=wait_before,write:8, fio would use
+\fBSYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE\fP for every 8 writes.
+Also see the sync_file_range(2) man page. This option is Linux specific.
+.TP
.BI overwrite \fR=\fPbool
If writing, setup the file first and do overwrites. Default: false.
.TP