From 789055cad45d7f6d870cfa2e4bc4515a4db9a575 Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Tue, 31 Aug 2021 14:20:55 -0700 Subject: [PATCH] bdev/nvme: Remove namespace types There's only one type now. Signed-off-by: Ben Walker Change-Id: I8fbf330797e772b1c45a04970c95bf4894c26639 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9348 Community-CI: Mellanox Build Bot Community-CI: Broadcom CI Tested-by: SPDK CI Jenkins Reviewed-by: Changpeng Liu Reviewed-by: Shuhei Matsumoto Reviewed-by: Jim Harris --- module/bdev/nvme/bdev_nvme.c | 7 +------ module/bdev/nvme/common.h | 7 ------- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/module/bdev/nvme/bdev_nvme.c b/module/bdev/nvme/bdev_nvme.c index 9cdc1e83fe..a6e23982a4 100644 --- a/module/bdev/nvme/bdev_nvme.c +++ b/module/bdev/nvme/bdev_nvme.c @@ -1769,7 +1769,7 @@ nvme_ctrlr_populate_namespaces(struct nvme_ctrlr *nvme_ctrlr, nvme_ns = nvme_ctrlr->namespaces[i]; ns_is_active = spdk_nvme_ctrlr_is_active_ns(ctrlr, nsid); - if (nvme_ns->populated && ns_is_active && nvme_ns->type == NVME_NS_STANDARD) { + if (nvme_ns->populated && ns_is_active) { /* NS is still there but attributes may have changed */ ns = spdk_nvme_ctrlr_get_ns(ctrlr, nsid); num_sectors = spdk_nvme_ns_get_num_sectors(ns); @@ -1792,7 +1792,6 @@ nvme_ctrlr_populate_namespaces(struct nvme_ctrlr *nvme_ctrlr, if (!nvme_ns->populated && ns_is_active) { nvme_ns->id = nsid; nvme_ns->ctrlr = nvme_ctrlr; - nvme_ns->type = NVME_NS_STANDARD; nvme_ns->bdev = NULL; @@ -2384,10 +2383,6 @@ nvme_ctrlr_populate_namespaces_done(struct nvme_ctrlr *nvme_ctrlr, } assert(nvme_ns->id == nsid); nvme_bdev = nvme_ns->bdev; - if (nvme_bdev == NULL) { - assert(nvme_ns->type == NVME_NS_OCSSD); - continue; - } if (j < ctx->count) { ctx->names[j] = nvme_bdev->disk.name; j++; diff --git a/module/bdev/nvme/common.h b/module/bdev/nvme/common.h index 129de3e8bb..a9ffd7771e 100644 --- a/module/bdev/nvme/common.h +++ b/module/bdev/nvme/common.h @@ -65,15 +65,8 @@ struct nvme_async_probe_ctx { bool namespaces_populated; }; -enum nvme_ns_type { - NVME_NS_UNKNOWN = 0, - NVME_NS_STANDARD = 1, - NVME_NS_OCSSD = 2, -}; - struct nvme_ns { uint32_t id; - enum nvme_ns_type type; /** Marks whether this data structure has its bdevs * populated for the associated namespace. It is used * to keep track if we need manage the populated