If we set ->ddir_nr to o.ddir_nr initally, we can remove the double
else in get_next_offset().
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
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->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 || td->o.new_group)
&& prev_group_jobs) {
if ((td->o.stonewall || td->o.numjobs > 1 || td->o.new_group)
&& prev_group_jobs) {
while (blocks < nr_blocks) {
unsigned int idx, bit;
while (blocks < nr_blocks) {
unsigned int idx, bit;
+ /*
+ * If we have a mixed random workload, we may
+ * encounter blocks we already did IO to.
+ */
if (!td->o.ddir_nr && !random_map_free(td, f, block))
break;
if (!td->o.ddir_nr && !random_map_free(td, f, block))
break;
int loops = 5;
if (td->o.ddir_nr) {
int loops = 5;
if (td->o.ddir_nr) {
td->ddir_nr = td->o.ddir_nr;
td->ddir_nr = td->o.ddir_nr;
- else if (--td->ddir_nr) {
b = f->last_pos / td->o.min_bs[ddir];
goto out;
b = f->last_pos / td->o.min_bs[ddir];
goto out;
- } else
- td->ddir_nr = td->o.ddir_nr;