Just clear ->odirect if it's a character device, it doesn't apply.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
}
if (td->bs_unaligned && (td->odirect || td->io_ops->flags & FIO_RAWIO))
log_err("fio: bs_unaligned may not work with raw io\n");
}
if (td->bs_unaligned && (td->odirect || td->io_ops->flags & FIO_RAWIO))
log_err("fio: bs_unaligned may not work with raw io\n");
+
+ /*
+ * O_DIRECT and char doesn't mix, clear that flag if necessary.
+ */
+ if (td->filetype == FIO_TYPE_CHAR && td->odirect)
+ td->odirect = 0;
if (td->odirect)
td->io_ops->flags |= FIO_RAWIO;
if (td->odirect)
td->io_ops->flags |= FIO_RAWIO;
td->filetype = FIO_TYPE_FILE;
if (!stat(jobname, &sb)) {
if (S_ISBLK(sb.st_mode))
td->filetype = FIO_TYPE_FILE;
if (!stat(jobname, &sb)) {
if (S_ISBLK(sb.st_mode))
td->filetype = FIO_TYPE_CHAR;
}
td->filetype = FIO_TYPE_CHAR;
}
if (td->filename)
td->nr_uniq_files = 1;
else
if (td->filename)
td->nr_uniq_files = 1;
else