if (bs > left)
bs = left;
- b = malloc(bs);
+ b = calloc(1, bs);
if (!b) {
td_verror(td, errno, "malloc");
ret = false;
goto error;
}
- memset(b, 0, bs);
if (lseek(f->fd, f->file_offset, SEEK_SET) < 0) {
td_verror(td, errno, "lseek");
if (!read_only)
flags |= O_RDWR;
+ if (td->o.verify_only) {
+ flags &= ~O_RDWR;
+ flags |= O_RDONLY;
+ }
+
if (f->filetype == FIO_TYPE_FILE && td->o.allow_create)
flags |= O_CREAT;
td_restore_runstate(td, old_state);
+ if (td->o.dp_type != FIO_DP_NONE) {
+ err = dp_init(td);
+ if (err)
+ goto err_out;
+ }
+
return 0;
err_offset:
nranges = (fsize + range_size - 1ULL) / range_size;
- seed = jhash(f->file_name, strlen(f->file_name), 0) * td->thread_number;
- if (!td->o.rand_repeatable)
- seed = td->rand_seeds[FIO_RAND_BLOCK_OFF];
+ seed = jhash(f->file_name, strlen(f->file_name), 0) * td->thread_number *
+ td->rand_seeds[FIO_RAND_BLOCK_OFF];
if (td->o.random_distribution == FIO_RAND_DIST_ZIPF)
zipf_init(&f->zipf, nranges, td->o.zipf_theta.u.f, td->o.random_center.u.f, seed);
{
if (fio_file_axmap(f))
axmap_free(f->io_axmap);
+ if (f->ruhs_info)
+ sfree(f->ruhs_info);
if (!fio_file_smalloc(f)) {
free(f->file_name);
free(f);
}
zbd_close_file(f);
+ fdp_free_ruhs_info(f);
fio_file_free(f);
}