return 1;
if (td->o.random_generator == FIO_RAND_GEN_TAUSWORTHE) {
- r = __rand(&td->__random_state);
+ r = __rand(&td->random_state);
dprint(FD_RANDOM, "off rand %llu\n", (unsigned long long) r);
if (td->o.perc_rand[ddir] == 100)
return 1;
- r = __rand(&td->__seq_rand_state[ddir]);
+ r = __rand(&td->seq_rand_state[ddir]);
v = 1 + (int) (100.0 * (r / (FRAND_MAX + 1.0)));
return v <= td->o.perc_rand[ddir];
return get_off_from_method(td, f, ddir, b);
if (!flist_empty(&td->next_rand_list)) {
- struct rand_off *r;
fetch:
r = flist_first_entry(&td->next_rand_list, struct rand_off, list);
flist_del(&r->list);
return 0;
do {
- r = __rand(&td->__bsrange_state);
+ r = __rand(&td->bsrange_state);
if (!td->o.bssplit_nr[ddir]) {
buflen = 1 + (unsigned int) ((double) maxbs *
unsigned int v;
unsigned long r;
- r = __rand(&td->__rwmix_state);
+ r = __rand(&td->rwmix_state);
v = 1 + (int) (100.0 * (r / (FRAND_MAX + 1.0)));
if (v <= td->o.rwmix[DDIR_READ])
if (td_rw(td) && __should_check_rate(td, odir))
td->rate_pending_usleep[odir] -= usec;
- if (ddir_trim(ddir))
- return ddir;
+ if (ddir == DDIR_TRIM)
+ return DDIR_TRIM;
return ddir;
}
int opened = 0;
unsigned long r;
- r = __rand(&td->__next_file_state);
+ r = __rand(&td->next_file_state);
fno = (unsigned int) ((double) td->o.nr_files
* (r / (FRAND_MAX + 1.0)));
{
struct io_u *io_u = NULL;
+ if (td->stop_io)
+ return NULL;
+
td_io_u_lock(td);
again:
if (!(io_u->flags & IO_U_F_VER_LIST))
td->this_io_bytes[ddir] += bytes;
- if (ddir == DDIR_WRITE && f) {
- if (f->first_write == -1ULL ||
- io_u->offset < f->first_write)
- f->first_write = io_u->offset;
- if (f->last_write == -1ULL ||
- ((io_u->offset + bytes) > f->last_write))
- f->last_write = io_u->offset + bytes;
+ if (ddir == DDIR_WRITE) {
+ if (f) {
+ if (f->first_write == -1ULL ||
+ io_u->offset < f->first_write)
+ f->first_write = io_u->offset;
+ if (f->last_write == -1ULL ||
+ ((io_u->offset + bytes) > f->last_write))
+ f->last_write = io_u->offset + bytes;
+ }
+ if (td->last_write_comp) {
+ int idx = td->last_write_idx++;
+
+ td->last_write_comp[idx] = io_u->offset;
+ if (td->last_write_idx == td->o.iodepth)
+ td->last_write_idx = 0;
+ }
}
if (ramp_time_over(td) && (td->runstate == TD_RUNNING ||