projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Various cleanups
[fio.git]
/
init.c
diff --git
a/init.c
b/init.c
index 048bd5d4fdec3183a37957f49a6d4f185b276977..5ff73859d50d444ed371c33a36c710182aa0bb38 100644
(file)
--- a/
init.c
+++ b/
init.c
@@
-47,7
+47,6
@@
static char **job_sections;
static int nr_job_sections;
int exitall_on_terminate = 0;
static int nr_job_sections;
int exitall_on_terminate = 0;
-int exitall_on_terminate_error = 0;
int output_format = FIO_OUTPUT_NORMAL;
int eta_print = FIO_ETA_AUTO;
int eta_new_line = 0;
int output_format = FIO_OUTPUT_NORMAL;
int eta_print = FIO_ETA_AUTO;
int eta_new_line = 0;
@@
-114,7
+113,7
@@
static struct option l_opts[FIO_NR_OPTIONS] = {
},
{
.name = (char *) "output-format",
},
{
.name = (char *) "output-format",
- .has_arg =
optional
_argument,
+ .has_arg =
required
_argument,
.val = 'F' | FIO_CLIENT_FLAG,
},
{
.val = 'F' | FIO_CLIENT_FLAG,
},
{
@@
-677,7
+676,7
@@
static int fixup_options(struct thread_data *td)
"verify limited\n");
ret = warnings_fatal;
}
"verify limited\n");
ret = warnings_fatal;
}
- if (o->bs_unaligned && (o->odirect || td
->io_ops->flags & FIO_RAWIO
))
+ if (o->bs_unaligned && (o->odirect || td
_ioengine_flagged(td, FIO_RAWIO)
))
log_err("fio: bs_unaligned may not work with raw io\n");
/*
log_err("fio: bs_unaligned may not work with raw io\n");
/*
@@
-764,7
+763,7
@@
static int fixup_options(struct thread_data *td)
if (o->pre_read) {
o->invalidate_cache = 0;
if (o->pre_read) {
o->invalidate_cache = 0;
- if (td
->io_ops->flags & FIO_PIPEIO
) {
+ if (td
_ioengine_flagged(td, FIO_PIPEIO)
) {
log_info("fio: cannot pre-read files with an IO engine"
" that isn't seekable. Pre-read disabled.\n");
ret = warnings_fatal;
log_info("fio: cannot pre-read files with an IO engine"
" that isn't seekable. Pre-read disabled.\n");
ret = warnings_fatal;
@@
-772,7
+771,7
@@
static int fixup_options(struct thread_data *td)
}
if (!o->unit_base) {
}
if (!o->unit_base) {
- if (td
->io_ops->flags & FIO_BIT_BASED
)
+ if (td
_ioengine_flagged(td, FIO_BIT_BASED)
)
o->unit_base = 1;
else
o->unit_base = 8;
o->unit_base = 1;
else
o->unit_base = 8;
@@
-795,7
+794,7
@@
static int fixup_options(struct thread_data *td)
* Windows doesn't support O_DIRECT or O_SYNC with the _open interface,
* so fail if we're passed those flags
*/
* Windows doesn't support O_DIRECT or O_SYNC with the _open interface,
* so fail if we're passed those flags
*/
- if (
(td->io_ops->flags &
FIO_SYNCIO) && (td->o.odirect || td->o.sync_io)) {
+ if (
td_ioengine_flagged(td,
FIO_SYNCIO) && (td->o.odirect || td->o.sync_io)) {
log_err("fio: Windows does not support direct or non-buffered io with"
" the synchronous ioengines. Use the 'windowsaio' ioengine"
" with 'direct=1' and 'iodepth=1' instead.\n");
log_err("fio: Windows does not support direct or non-buffered io with"
" the synchronous ioengines. Use the 'windowsaio' ioengine"
" with 'direct=1' and 'iodepth=1' instead.\n");
@@
-844,7
+843,7
@@
static int fixup_options(struct thread_data *td)
if (fio_option_is_set(&td->o, rand_seed))
td->o.rand_repeatable = 0;
if (fio_option_is_set(&td->o, rand_seed))
td->o.rand_repeatable = 0;
- if (
(td->io_ops->flags &
FIO_NOEXTEND) && td->o.file_append) {
+ if (
td_ioengine_flagged(td,
FIO_NOEXTEND) && td->o.file_append) {
log_err("fio: can't append/extent with IO engine %s\n", td->io_ops->name);
ret = 1;
}
log_err("fio: can't append/extent with IO engine %s\n", td->io_ops->name);
ret = 1;
}
@@
-1069,6
+1068,10
@@
int ioengine_load(struct thread_data *td)
*(struct thread_data **)td->eo = td;
}
*(struct thread_data **)td->eo = td;
}
+ if (td->o.odirect)
+ td->io_ops->flags |= FIO_RAWIO;
+
+ td_set_ioengine_flags(td);
return 0;
}
return 0;
}
@@
-1244,7
+1247,7
@@
static char *make_filename(char *buf, size_t buf_size,struct thread_options *o,
return buf;
}
return buf;
}
-
int
parse_dryrun(void)
+
bool
parse_dryrun(void)
{
return dump_cmdline || parse_only;
}
{
return dump_cmdline || parse_only;
}
@@
-1340,9
+1343,6
@@
static int add_job(struct thread_data *td, const char *jobname, int job_add_num,
if (ioengine_load(td))
goto err;
if (ioengine_load(td))
goto err;
- if (o->odirect)
- td->io_ops->flags |= FIO_RAWIO;
-
file_alloced = 0;
if (!o->filename && !td->files_index && !o->read_iolog_file) {
file_alloced = 1;
file_alloced = 0;
if (!o->filename && !td->files_index && !o->read_iolog_file) {
file_alloced = 1;
@@
-1373,7
+1373,7
@@
static int add_job(struct thread_data *td, const char *jobname, int job_add_num,
if (td->eo)
*(struct thread_data **)td->eo = NULL;
if (td->eo)
*(struct thread_data **)td->eo = NULL;
- if (td
->io_ops->flags & FIO_DISKLESSIO
) {
+ if (td
_ioengine_flagged(td, FIO_DISKLESSIO)
) {
struct fio_file *f;
for_each_file(td, f, i)
struct fio_file *f;
for_each_file(td, f, i)
@@
-1537,7
+1537,7
@@
static int add_job(struct thread_data *td, const char *jobname, int job_add_num,
if (is_backend && !recursed)
fio_server_send_add_job(td);
if (is_backend && !recursed)
fio_server_send_add_job(td);
- if (!
(td->io_ops->flags &
FIO_NOIO)) {
+ if (!
td_ioengine_flagged(td,
FIO_NOIO)) {
char *c1, *c2, *c3, *c4;
char *c5 = NULL, *c6 = NULL;
char *c1, *c2, *c3, *c4;
char *c5 = NULL, *c6 = NULL;
@@
-2302,7
+2302,7
@@
int parse_cmd_line(int argc, char *argv[], int client_type)
struct thread_data *td = NULL;
int c, ini_idx = 0, lidx, ret = 0, do_exit = 0, exit_val = 0;
char *ostr = cmd_optstr;
struct thread_data *td = NULL;
int c, ini_idx = 0, lidx, ret = 0, do_exit = 0, exit_val = 0;
char *ostr = cmd_optstr;
-
void
*pid_file = NULL;
+
char
*pid_file = NULL;
void *cur_client = NULL;
int backend = 0;
void *cur_client = NULL;
int backend = 0;
@@
-2352,12
+2352,6
@@
int parse_cmd_line(int argc, char *argv[], int client_type)
output_format = FIO_OUTPUT_TERSE;
break;
case 'F':
output_format = FIO_OUTPUT_TERSE;
break;
case 'F':
- if (!optarg) {
- log_err("fio: missing --output-format argument\n");
- exit_val = 1;
- do_exit++;
- break;
- }
if (parse_output_format(optarg)) {
log_err("fio: failed parsing output-format\n");
exit_val = 1;
if (parse_output_format(optarg)) {
log_err("fio: failed parsing output-format\n");
exit_val = 1;