assert(!ret);
}
-static inline struct fio_zone_info *get_zone(const struct fio_file *f,
- unsigned int zone_nr)
+static inline struct fio_zone_info *zbd_get_zone(const struct fio_file *f,
+ unsigned int zone_idx)
{
- return &f->zbd_info->zone_info[zone_nr];
+ return &f->zbd_info->zone_info[zone_idx];
}
/**
return;
for (ozi = 0; ozi < f->zbd_info->num_open_zones; ozi++) {
- if (get_zone(f, f->zbd_info->open_zones[ozi]) == z)
+ if (zbd_get_zone(f, f->zbd_info->open_zones[ozi]) == z)
break;
}
if (ozi == f->zbd_info->num_open_zones)
zone_idx_e =
zbd_offset_to_zone_idx(f, f->file_offset + f->io_size - 1);
for (zone_idx = zone_idx_b; zone_idx <= zone_idx_e; zone_idx++)
- if (get_zone(f, zone_idx)->has_wp)
+ if (zbd_get_zone(f, zone_idx)->has_wp)
return true;
return false;
}
zone_idx = zbd_offset_to_zone_idx(f, f->file_offset);
- z = get_zone(f, zone_idx);
+ z = zbd_get_zone(f, zone_idx);
if ((f->file_offset != z->start) &&
(td->o.td_ddir != TD_DDIR_READ)) {
new_offset = zbd_zone_end(z);
}
zone_idx = zbd_offset_to_zone_idx(f, f->file_offset + f->io_size);
- z = get_zone(f, zone_idx);
+ z = zbd_get_zone(f, zone_idx);
new_end = z->start;
if ((td->o.td_ddir != TD_DDIR_READ) &&
(f->file_offset + f->io_size != new_end)) {
uint64_t swd = 0;
uint64_t wp_swd = 0;
- zb = get_zone(f, f->min_zone);
- ze = get_zone(f, f->max_zone);
+ zb = zbd_get_zone(f, f->min_zone);
+ ze = zbd_get_zone(f, f->max_zone);
for (z = zb; z < ze; z++) {
if (z->has_wp) {
zone_lock(td, f, z);
if (!f->zbd_info || !td_write(td))
return;
- zb = get_zone(f, f->min_zone);
- ze = get_zone(f, f->max_zone);
+ zb = zbd_get_zone(f, f->min_zone);
+ ze = zbd_get_zone(f, f->max_zone);
swd = zbd_process_swd(td, f, SET_SWD);
dprint(FD_ZBD, "%s(%s): swd = %" PRIu64 "\n",
for (;;) {
uint32_t tmp_idx;
- z = get_zone(f, zone_idx);
+ z = zbd_get_zone(f, zone_idx);
if (z->has_wp)
zone_lock(td, f, z);
if (!is_valid_offset(f, z->start)) {
/* Wrap-around. */
zone_idx = f->min_zone;
- z = get_zone(f, zone_idx);
+ z = zbd_get_zone(f, zone_idx);
}
assert(is_valid_offset(f, z->start));
if (!z->has_wp)
pthread_mutex_unlock(&zbdi->mutex);
zone_unlock(z);
- z = get_zone(f, zone_idx);
+ z = zbd_get_zone(f, zone_idx);
zone_lock(td, f, z);
if (z->wp + min_bs <= zbd_zone_capacity_end(z))
{
struct fio_file *f = io_u->file;
struct fio_zone_info *z1, *z2;
- const struct fio_zone_info *const zf = get_zone(f, f->min_zone);
+ const struct fio_zone_info *const zf = zbd_get_zone(f, f->min_zone);
/*
* Skip to the next non-empty zone in case of sequential I/O and to
zone_idx = zbd_offset_to_zone_idx(f, io_u->offset);
assert(zone_idx < zbd_info->nr_zones);
- z = get_zone(f, zone_idx);
+ z = zbd_get_zone(f, zone_idx);
assert(z->has_wp);
zone_idx = zbd_offset_to_zone_idx(f, io_u->offset);
assert(zone_idx < zbd_info->nr_zones);
- z = get_zone(f, zone_idx);
+ z = zbd_get_zone(f, zone_idx);
assert(z->has_wp);
assert(f->zbd_info);
zone_idx = zbd_offset_to_zone_idx(f, f->last_pos[ddir]);
- z = get_zone(f, zone_idx);
+ z = zbd_get_zone(f, zone_idx);
/*
* When the zone capacity is smaller than the zone size and the I/O is
assert(io_u->buflen);
zone_idx_b = zbd_offset_to_zone_idx(f, io_u->offset);
- zb = get_zone(f, zone_idx_b);
+ zb = zbd_get_zone(f, zone_idx_b);
orig_zb = zb;
if (!zb->has_wp) {
if (range < min_bs ||
((!td_random(td)) && (io_u->offset + min_bs > zb->wp))) {
zone_unlock(zb);
- zl = get_zone(f, f->max_zone);
+ zl = zbd_get_zone(f, f->max_zone);
zb = zbd_find_zone(td, io_u, min_bs, zb, zl);
if (!zb) {
dprint(FD_ZBD,
/* Find out a non-empty zone to trim */
zone_unlock(zb);
- zl = get_zone(f, f->max_zone);
+ zl = zbd_get_zone(f, f->max_zone);
zb = zbd_find_zone(td, io_u, 1, zb, zl);
if (zb) {
io_u->offset = zb->start;
int ret;
zone_idx = zbd_offset_to_zone_idx(f, io_u->offset);
- z = get_zone(f, zone_idx);
+ z = zbd_get_zone(f, zone_idx);
if (!z->has_wp)
return 0;