}
pthread_mutex_lock(&f->zbd_info->mutex);
- f->zbd_info->sectors_with_data -= data_in_zone;
f->zbd_info->wp_sectors_with_data -= data_in_zone;
pthread_mutex_unlock(&f->zbd_info->mutex);
const struct fio_file *f, enum swd_action a)
{
struct fio_zone_info *zb, *ze, *z;
- uint64_t swd = 0;
uint64_t wp_swd = 0;
zb = zbd_get_zone(f, f->min_zone);
zone_lock(td, f, z);
wp_swd += z->wp - z->start;
}
- swd += z->wp - z->start;
}
pthread_mutex_lock(&f->zbd_info->mutex);
switch (a) {
case CHECK_SWD:
- assert(f->zbd_info->sectors_with_data == swd);
assert(f->zbd_info->wp_sectors_with_data == wp_swd);
break;
case SET_SWD:
- f->zbd_info->sectors_with_data = swd;
f->zbd_info->wp_sectors_with_data = wp_swd;
break;
}
if (z->has_wp)
zone_unlock(z);
- return swd;
+ return wp_swd;
}
/*
* have occurred.
*/
pthread_mutex_lock(&zbd_info->mutex);
- if (z->wp <= zone_end) {
- zbd_info->sectors_with_data += zone_end - z->wp;
+ if (z->wp <= zone_end)
zbd_info->wp_sectors_with_data += zone_end - z->wp;
- }
pthread_mutex_unlock(&zbd_info->mutex);
z->wp = zone_end;
break;
if (ddir != DDIR_READ || !td_rw(td))
return ddir;
- if (io_u->file->zbd_info->sectors_with_data ||
- td->o.read_beyond_wp)
+ if (io_u->file->last_start[DDIR_WRITE] != -1ULL || td->o.read_beyond_wp)
return DDIR_READ;
return DDIR_WRITE;
* @mutex: Protects the modifiable members in this structure (refcount and
* num_open_zones).
* @zone_size: size of a single zone in bytes.
- * @sectors_with_data: total size of data in all zones in units of 512 bytes
* @wp_sectors_with_data: total size of data in zones with write pointers in
* units of 512 bytes
* @zone_size_log2: log2 of the zone size in bytes if it is a power of 2 or 0
uint32_t max_open_zones;
pthread_mutex_t mutex;
uint64_t zone_size;
- uint64_t sectors_with_data;
uint64_t wp_sectors_with_data;
uint32_t zone_size_log2;
uint32_t nr_zones;