aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2018-03-08 20:35:22 -0600
committerEric Sandeen <sandeen@redhat.com>2018-03-08 20:35:22 -0600
commitd97638251b67861786b3dbfeab6555c5ea3660b0 (patch)
treee2f8b2db1975ea1f400288191def6b321b016269
parent9d50331ab193c26d133bc8fd164f1054fb87312f (diff)
downloadxfsprogs-dev-d97638251b67861786b3dbfeab6555c5ea3660b0.tar.gz
xfs_io: add RWF_DSYNC support to pwrite
Enable testing write behaviour with the per-io RWF_DSYNC flag. Signed-Off-By: Dave Chinner <dchinner@redhat.com> Reviewed-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
-rw-r--r--io/pwrite.c8
-rw-r--r--man/man8/xfs_io.810
2 files changed, 14 insertions, 4 deletions
diff --git a/io/pwrite.c b/io/pwrite.c
index afbe428441..d06af4b3c1 100644
--- a/io/pwrite.c
+++ b/io/pwrite.c
@@ -56,6 +56,7 @@ pwrite_help(void)
#endif
#ifdef HAVE_PWRITEV2
" -N -- Perform the pwritev2() with RWF_NOWAIT\n"
+" -D -- Perform the pwritev2() with RWF_DSYNC\n"
#endif
"\n"));
}
@@ -301,7 +302,7 @@ pwrite_f(
init_cvtnum(&fsblocksize, &fssectsize);
bsize = fsblocksize;
- while ((c = getopt(argc, argv, "b:BCdf:Fi:NqRs:OS:uV:wWZ:")) != EOF) {
+ while ((c = getopt(argc, argv, "b:BCdDf:Fi:NqRs:OS:uV:wWZ:")) != EOF) {
switch (c) {
case 'b':
tmp = cvtnum(fsblocksize, fssectsize, optarg);
@@ -337,6 +338,9 @@ pwrite_f(
case 'N':
pwritev2_flags |= RWF_NOWAIT;
break;
+ case 'D':
+ pwritev2_flags |= RWF_DSYNC;
+ break;
#endif
case 's':
skip = cvtnum(fsblocksize, fssectsize, optarg);
@@ -471,7 +475,7 @@ pwrite_init(void)
pwrite_cmd.argmax = -1;
pwrite_cmd.flags = CMD_NOMAP_OK | CMD_FOREIGN_OK;
pwrite_cmd.args =
-_("[-i infile [-dwNOW] [-s skip]] [-b bs] [-S seed] [-FBR [-Z N]] [-V N] off len");
+_("[-i infile [-dDwNOW] [-s skip]] [-b bs] [-S seed] [-FBR [-Z N]] [-V N] off len");
pwrite_cmd.oneline =
_("writes a number of bytes at a specified offset");
pwrite_cmd.help = pwrite_help;
diff --git a/man/man8/xfs_io.8 b/man/man8/xfs_io.8
index 364088c82c..c3ab532da0 100644
--- a/man/man8/xfs_io.8
+++ b/man/man8/xfs_io.8
@@ -222,7 +222,7 @@ See the
.B pread
command.
.TP
-.BI "pwrite [ \-i " file " ] [ \-dwNOW ] [ \-s " skip " ] [ \-b " size " ] [ \-S " seed " ] [ \-FBR [ \-Z " zeed " ] ] [ \-V " vectors " ] " "offset length"
+.BI "pwrite [ \-i " file " ] [ \-dDwNOW ] [ \-s " skip " ] [ \-b " size " ] [ \-S " seed " ] [ \-FBR [ \-Z " zeed " ] ] [ \-V " vectors " ] " "offset length"
Writes a range of bytes in a specified blocksize from the given
.IR offset .
The bytes written can be either a set pattern or read in from another
@@ -248,7 +248,13 @@ once all writes are complete (included in timing results)
Perform the
.BR pwritev2 (2)
call with
-.I RWF_NOWAIT.
+.IR RWF_NOWAIT .
+.TP
+.B \-D
+Perform the
+.BR pwritev2 (2)
+call with
+.IR RWF_DSYNC .
.TP
.B \-O
perform pwrite once and return the (maybe partial) bytes written.