Unfortunately, generic fio code calls some zbd_* functions unconditionally.
These functions will be called regardless if zonemode == ZONE_MODE_NONE,
ZONE_MODE_STRIDED or ZONE_MODE_ZBD, and cannot be optimized.
However, some functions are only called when zonemode == ZONE_MODE_ZBD.
Since f->zbd_info will always be non-NULL for a job with zonemode=zbd,
these functions can be optimized to not check if f->zbd_info is set.
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
struct fio_zone_info *z;
int zi;
struct fio_zone_info *z;
int zi;
f->min_zone = zbd_zone_idx(f, f->file_offset);
f->max_zone = zbd_zone_idx(f, f->file_offset + f->io_size);
f->min_zone = zbd_zone_idx(f, f->file_offset);
f->max_zone = zbd_zone_idx(f, f->file_offset + f->io_size);
uint32_t zone_idx;
uint64_t zone_end;
uint32_t zone_idx;
uint64_t zone_end;
- if (!zbd_info)
- return;
zone_idx = zbd_zone_idx(f, io_u->offset);
assert(zone_idx < zbd_info->nr_zones);
zone_idx = zbd_zone_idx(f, io_u->offset);
assert(zone_idx < zbd_info->nr_zones);
struct fio_zone_info *z;
uint32_t zone_idx;
struct fio_zone_info *z;
uint32_t zone_idx;
- if (!zbd_info)
- return;
zone_idx = zbd_zone_idx(f, io_u->offset);
assert(zone_idx < zbd_info->nr_zones);
zone_idx = zbd_zone_idx(f, io_u->offset);
assert(zone_idx < zbd_info->nr_zones);
assert(td->o.zone_mode == ZONE_MODE_ZBD);
assert(td->o.zone_size);
assert(td->o.zone_mode == ZONE_MODE_ZBD);
assert(td->o.zone_size);
zone_idx = zbd_zone_idx(f, f->last_pos[ddir]);
z = get_zone(f, zone_idx);
zone_idx = zbd_zone_idx(f, f->last_pos[ddir]);
z = get_zone(f, zone_idx);
* devices with all empty zones. Overwrite the first I/O direction as
* write to make sure data to read exists.
*/
* devices with all empty zones. Overwrite the first I/O direction as
* write to make sure data to read exists.
*/
+ assert(io_u->file->zbd_info);
if (ddir != DDIR_READ || !td_rw(td))
return ddir;
if (ddir != DDIR_READ || !td_rw(td))
return ddir;
uint64_t new_len;
int64_t range;
uint64_t new_len;
int64_t range;
- if (!f->zbd_info)
- return io_u_accept;
-
assert(min_bs);
assert(is_valid_offset(f, io_u->offset));
assert(io_u->buflen);
assert(min_bs);
assert(is_valid_offset(f, io_u->offset));
assert(io_u->buflen);