zbd: rename 'open zones' to 'write zones'
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Thu, 8 Jun 2023 07:06:02 +0000 (16:06 +0900)
committerVincent Fu <vincent.fu@samsung.com>
Thu, 8 Jun 2023 18:39:07 +0000 (14:39 -0400)
commita48070461ed561ce040e15d98702d335179581fa
tree5b66226b3b0a99a4af398fc108cddabbd6d36d89
parent03317fbb1548fef308decf29b4ce3c8bb31d01cb
zbd: rename 'open zones' to 'write zones'

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@wdc.com>
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
fio.h
options.c
zbd.c
zbd.h
zbd_types.h