On Wed, Jun 07, 2023 at 05:32:24PM +0900, Shin'ichiro Kawasaki wrote: > Current fio code for zonemode=zbd uses the word 'open zone' to mean the > zones that fio jobs write to. Before fio starts writing to a zone, it > calls zbd_open_zone(). When fio completes writing to a zone, it calls > zbd_close_zone(). This wording is good for zoned block devices with > max_open_zones limit, such as ZBC and ZAC devices. The devices use same > word 'open' to express the zone condition that the devices assign > resources for data write to zones. However, the word 'open' gets > confusing to support zoned block devices which has max_active_zones > limit, such as ZNS devices. These devices have both 'open' and 'active' > keywords to mean two different kinds of resources on the device. This > 'active' status does not fit with the 'open zone' wording in the fio > code. Also, the word 'open' zone in fio code does not always match with > the 'open' condition of zones on the device (e.g. when > --ignore_zone_limits option is specified). > > To avoid the confusion, stop using the word 'open zone' in the fio code. > Instead, use the word 'write zone' to mean that the zone is the write > target. When fio starts a write to a zone, it adds the zone to > write_zones array. When fio completes writing to a zone, it removes the > zone from the write_zones array. For this purpose, rename struct fields, > functions and a macro: > > ZBD_MAX_OPEN_ZONES -> ZBD_MAX_WRITE_ZONES > struct fio_zone_info > open -> write > struct thread_data > num_open_zones -> num_write_zones > struct zoned_block_device_info: > max_open_zones -> max_write_zones > num_open_zones -> num_write_zones > open_zones[] -> write_zones[] > zbd_open_zone() -> zbd_write_zone_get() > zbd_close_zone() -> zbd_write_zone_put() > zbd_convert_to_open_zone() -> zbd_convert_to_write_zone() > > To match up these changes, rename local variables and goto labels. Also > rephrase code comments. > > Of note is that this rename is only for the fio code. The fio options > max_open_zones and job_max_open_zones are not renamed to not confuse > users. > > Suggested-by: Niklas Cassel <niklas.cassel@xxxxxxx> > Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@xxxxxxx> > --- Reviewed-by: Niklas Cassel <niklas.cassel@xxxxxxx>