From: Dmitry Fomichev Date: Tue, 6 Feb 2024 10:57:53 +0000 (+0900) Subject: zbd: use a helper to calculate zone index X-Git-Tag: fio-3.37~54 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=69c53a63667f914ebf7e7a85c83351d90a7e2bc8;p=fio.git 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 Reviewed-by: Shin'ichiro Kawasaki Tested-by: Shin'ichiro Kawasaki Link: https://lore.kernel.org/r/20240206105755.214891-4-dmitry.fomichev@wdc.com Signed-off-by: Vincent Fu --- diff --git a/zbd.c b/zbd.c index 7577472e..37417660 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);