aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Fomichev <dmitry.fomichev@wdc.com>2024-02-06 19:57:53 +0900
committerVincent Fu <vincent.fu@samsung.com>2024-02-07 08:43:13 -0500
commit69c53a63667f914ebf7e7a85c83351d90a7e2bc8 (patch)
treea9e62547abffe199a34dfe10fd56cdc282d07520
parentdb46d820d092aebd345b340c526b9dcbabc76748 (diff)
downloadfio-69c53a63667f914ebf7e7a85c83351d90a7e2bc8.tar.gz
zbd: use a helper to calculate zone index
zone_lock() function contains the debug code to verify that the zone being locked belongs to the job's working zone range. Clean up this code by using a previously defined helper for calculating the zone index to check. Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com> Reviewed-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com> Tested-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com> Link: https://lore.kernel.org/r/20240206105755.214891-4-dmitry.fomichev@wdc.com Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
-rw-r--r--zbd.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/zbd.c b/zbd.c
index 7577472e9..374176605 100644
--- a/zbd.c
+++ b/zbd.c
@@ -104,8 +104,7 @@ static void zone_lock(struct thread_data *td, const struct fio_file *f,
struct fio_zone_info *z)
{
#ifndef NDEBUG
- struct zoned_block_device_info *zbd = f->zbd_info;
- uint32_t const nz = z - zbd->zone_info;
+ unsigned int const nz = zbd_zone_idx(f, z);
/* A thread should never lock zones outside its working area. */
assert(f->min_zone <= nz && nz < f->max_zone);
assert(z->has_wp);