Change the default from O_DIRECT IO to normal buffered IO. That makes
more sense, as O_DIRECT is a special case and should be manually
enabled as such.
Do this by adding a option negate switch, so we don't need two sets
of parameters to control these options.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
concurrency.
direct=bool If value is true, use non-buffered io. This is usually
- O_DIRECT. Defaults to true.
+ O_DIRECT.
+
+buffered=bool If value is true, use buffered io. This is the opposite
+ of the 'direct' option. Defaults to true.
offset=siint Start io at the given offset in the file. The data before
the given offset will not be touched. This effectively
.name = "direct",
.type = FIO_OPT_BOOL,
.off1 = td_var_offset(odirect),
- .help = "Use O_DIRECT IO",
+ .help = "Use O_DIRECT IO (negates buffered)",
+ .def = "0",
+ },
+ {
+ .name = "buffered",
+ .type = FIO_OPT_BOOL,
+ .off1 = td_var_offset(odirect),
+ .neg = 1,
+ .help = "Use buffered IO (negates direct)",
.def = "1",
},
{
return 1;
}
+ if (o->neg)
+ il = !il;
+
if (fn)
ret = fn(data, &il);
else {
unsigned int off4;
unsigned int maxval; /* max and min value */
int minval;
+ int neg; /* negate value stored */
void *cb; /* callback */
const char *help; /* help text for option */
const char *def; /* default setting */