From 10f5e66186acea74e5ccf9fe235381c005603c2a Mon Sep 17 00:00:00 2001 From: Niklas Cassel Date: Thu, 11 Nov 2021 01:21:20 +0000 Subject: [PATCH] bdev_fio: use the new bdev_get_zone_id() helper Use the new bdev_get_zone_id() helper when calculating the zslba. Signed-off-by: Niklas Cassel Change-Id: I370a9ea3f82368e7b1a764bf221378797defe6b0 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10181 Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Ben Walker Reviewed-by: Jim Harris --- examples/bdev/fio_plugin/fio_plugin.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/bdev/fio_plugin/fio_plugin.c b/examples/bdev/fio_plugin/fio_plugin.c index 7e435310f..071365b99 100644 --- a/examples/bdev/fio_plugin/fio_plugin.c +++ b/examples/bdev/fio_plugin/fio_plugin.c @@ -745,8 +745,7 @@ spdk_fio_zone_bytes_to_blocks(struct spdk_bdev *bdev, uint64_t offset_bytes, uin uint64_t num_bytes, uint64_t *num_blocks) { uint32_t block_size = spdk_bdev_get_block_size(bdev); - *zone_start = (offset_bytes / (spdk_bdev_get_zone_size(bdev) * block_size)) * - spdk_bdev_get_zone_size(bdev); + *zone_start = spdk_bdev_get_zone_id(bdev, offset_bytes / block_size); *num_blocks = num_bytes / block_size; return (offset_bytes % block_size) | (num_bytes % block_size); }