From 05e97101b2c012b12049a77392d9592f3c17d2f8 Mon Sep 17 00:00:00 2001 From: Maciej Szwed Date: Wed, 2 Oct 2019 12:40:06 +0200 Subject: [PATCH] bdev/nvme: Change nvme_async_probe_ctx->count type to uint32_t This also requires change of type for count field in rpc_bdev_nvme_attach_controller_ctx structure and argument type in spdk_bdev_nvme_create function. Signed-off-by: Maciej Szwed Change-Id: Ifc679558b0744ada021f5ce367beb83b35f30b3a Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470135 Tested-by: SPDK CI Jenkins Reviewed-by: Shuhei Matsumoto Reviewed-by: Jim Harris Reviewed-by: Ben Walker --- module/bdev/nvme/bdev_nvme.c | 5 +++-- module/bdev/nvme/bdev_nvme.h | 3 ++- module/bdev/nvme/bdev_nvme_rpc.c | 2 +- module/bdev/nvme/common.h | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/module/bdev/nvme/bdev_nvme.c b/module/bdev/nvme/bdev_nvme.c index 40baf51bf..573f68d5d 100644 --- a/module/bdev/nvme/bdev_nvme.c +++ b/module/bdev/nvme/bdev_nvme.c @@ -1218,7 +1218,7 @@ bdev_nvme_create_bdevs(struct nvme_async_probe_ctx *ctx) ctx->names[j] = nvme_bdev->disk.name; j++; } else { - SPDK_ERRLOG("Maximum number of namespaces supported per NVMe controller is %zu. Unable to return all names of created bdevs\n", + SPDK_ERRLOG("Maximum number of namespaces supported per NVMe controller is %du. Unable to return all names of created bdevs\n", *ctx->count); return -1; } @@ -1278,7 +1278,8 @@ int spdk_bdev_nvme_create(struct spdk_nvme_transport_id *trid, struct spdk_nvme_host_id *hostid, const char *base_name, - const char **names, size_t *count, + const char **names, + uint32_t *count, const char *hostnqn, uint32_t prchk_flags, spdk_bdev_create_nvme_fn cb_fn, diff --git a/module/bdev/nvme/bdev_nvme.h b/module/bdev/nvme/bdev_nvme.h index 23f65eb89..490408449 100644 --- a/module/bdev/nvme/bdev_nvme.h +++ b/module/bdev/nvme/bdev_nvme.h @@ -69,7 +69,8 @@ int spdk_bdev_nvme_set_hotplug(bool enabled, uint64_t period_us, spdk_msg_fn cb, int spdk_bdev_nvme_create(struct spdk_nvme_transport_id *trid, struct spdk_nvme_host_id *hostid, const char *base_name, - const char **names, size_t *count, + const char **names, + uint32_t *count, const char *hostnqn, uint32_t prchk_flags, spdk_bdev_create_nvme_fn cb_fn, diff --git a/module/bdev/nvme/bdev_nvme_rpc.c b/module/bdev/nvme/bdev_nvme_rpc.c index 2adfb4750..409e52dae 100644 --- a/module/bdev/nvme/bdev_nvme_rpc.c +++ b/module/bdev/nvme/bdev_nvme_rpc.c @@ -210,7 +210,7 @@ static const struct spdk_json_object_decoder rpc_bdev_nvme_attach_controller_dec struct rpc_bdev_nvme_attach_controller_ctx { struct rpc_bdev_nvme_attach_controller req; - size_t count; + uint32_t count; const char *names[NVME_MAX_BDEVS_PER_RPC]; struct spdk_jsonrpc_request *request; }; diff --git a/module/bdev/nvme/common.h b/module/bdev/nvme/common.h index 4c9402929..7fcf134b6 100644 --- a/module/bdev/nvme/common.h +++ b/module/bdev/nvme/common.h @@ -87,7 +87,7 @@ struct nvme_async_probe_ctx { struct spdk_nvme_probe_ctx *probe_ctx; const char *base_name; const char **names; - size_t *count; + uint32_t *count; uint32_t prchk_flags; struct spdk_poller *poller; struct spdk_nvme_transport_id trid;