{
uint32_t refcount;
- if (!f->zbd_info)
- return;
+ assert(f->zbd_info);
pthread_mutex_lock(&f->zbd_info->mutex);
refcount = --f->zbd_info->refcount;
return ret;
}
-int zbd_init(struct thread_data *td)
+int zbd_setup_files(struct thread_data *td)
{
struct fio_file *f;
int i;
reset_wp = z->wp != z->start;
} else {
- reset_wp = (td->o.td_ddir & TD_DDIR_WRITE) &&
- z->wp % min_bs != 0;
+ reset_wp = z->wp % min_bs != 0;
}
if (reset_wp) {
dprint(FD_ZBD, "%s: resetting zone %u\n",
struct fio_zone_info *zb, *ze;
uint32_t zone_idx_e;
- if (!f->zbd_info)
+ if (!f->zbd_info || !td_write(td))
return;
zb = &f->zbd_info->zone_info[zbd_zone_idx(f, f->file_offset)];
* writing data, which causes data loss.
*/
zbd_reset_zones(td, f, zb, ze, td->o.verify != VERIFY_NONE &&
- (td->o.td_ddir & TD_DDIR_WRITE) &&
td->runstate != TD_VERIFYING);
zbd_reset_write_cnt(td, f);
}