projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix bug with numjobs > 1, directory and filename given
[fio.git]
/
init.c
diff --git
a/init.c
b/init.c
index 23fe8dc69e2bfb820e9de322919bd315eac9249a..1e0eeccfdc6e5dcbf0b95b0fa479e111108826f6 100644
(file)
--- a/
init.c
+++ b/
init.c
@@
-171,8
+171,8
@@
static int fixup_options(struct thread_data *td)
{
struct thread_options *o = &td->o;
{
struct thread_options *o = &td->o;
- if (
!o->rwmixread && o->rwmixwrite
)
- o->rwmix
read = 100 - o->rwmixwrite
;
+ if (
o->rwmix[DDIR_READ] + o->rwmix[DDIR_WRITE] > 100
)
+ o->rwmix
[DDIR_WRITE] = 100 - o->rwmix[DDIR_READ]
;
if (o->write_iolog_file && o->read_iolog_file) {
log_err("fio: read iolog overrides write_iolog\n");
if (o->write_iolog_file && o->read_iolog_file) {
log_err("fio: read iolog overrides write_iolog\n");
@@
-358,7
+358,6
@@
static int init_random_state(struct thread_data *td)
return 0;
}
return 0;
}
-
/*
* Adds a job to the list of things todo. Sanitizes the various options
* to make sure we don't have conflicts, and initializes various
/*
* Adds a job to the list of things todo. Sanitizes the various options
* to make sure we don't have conflicts, and initializes various
@@
-369,7
+368,6
@@
static int add_job(struct thread_data *td, const char *jobname, int job_add_num)
const char *ddir_str[] = { NULL, "read", "write", "rw", NULL,
"randread", "randwrite", "randrw" };
unsigned int i;
const char *ddir_str[] = { NULL, "read", "write", "rw", NULL,
"randread", "randwrite", "randrw" };
unsigned int i;
- struct fio_file *f;
const char *engine;
char fname[PATH_MAX];
int numjobs, file_alloced;
const char *engine;
char fname[PATH_MAX];
int numjobs, file_alloced;
@@
-412,20
+410,15
@@
static int add_job(struct thread_data *td, const char *jobname, int job_add_num)
if (fixup_options(td))
goto err;
if (fixup_options(td))
goto err;
- for_each_file(td, f, i) {
- if (td->o.directory && f->filetype == FIO_TYPE_FILE) {
- sprintf(fname, "%s/%s", td->o.directory, f->file_name);
- f->file_name = strdup(fname);
- }
- }
-
td->mutex = fio_sem_init(0);
td->ts.clat_stat[0].min_val = td->ts.clat_stat[1].min_val = ULONG_MAX;
td->ts.slat_stat[0].min_val = td->ts.slat_stat[1].min_val = ULONG_MAX;
td->ts.bw_stat[0].min_val = td->ts.bw_stat[1].min_val = ULONG_MAX;
td->mutex = fio_sem_init(0);
td->ts.clat_stat[0].min_val = td->ts.clat_stat[1].min_val = ULONG_MAX;
td->ts.slat_stat[0].min_val = td->ts.slat_stat[1].min_val = ULONG_MAX;
td->ts.bw_stat[0].min_val = td->ts.bw_stat[1].min_val = ULONG_MAX;
+ td->ddir_nr = td->o.ddir_nr;
- if ((td->o.stonewall || td->o.numjobs > 1) && prev_group_jobs) {
+ if ((td->o.stonewall || td->o.numjobs > 1 || td->o.new_group)
+ && prev_group_jobs) {
prev_group_jobs = 0;
groupid++;
}
prev_group_jobs = 0;
groupid++;
}
@@
-498,11
+491,6
@@
static int add_job(struct thread_data *td, const char *jobname, int job_add_num)
goto err;
}
goto err;
}
- if (td->o.numjobs > 1) {
- groupid++;
- prev_group_jobs = 0;
- }
-
return 0;
err:
put_job(td);
return 0;
err:
put_job(td);