From c57bf804970b6ecea8bff5effd065bd04ff2da0a Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Mon, 18 Oct 2021 14:18:11 -0700 Subject: [PATCH] nvme: Do not construct the namespace object on ns_create Wait until the namespace is attached, where it does this operation again. As of this commit it doesn't really matter because it is just filling in some values in a structure and if it does it twice it's not a problem. But later when we only allocate active namespaces, we do not want to allocate the namespace twice. Signed-off-by: Ben Walker Change-Id: Ie28653b178975d1ca80bf71ca6b5095224f1c5d1 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10026 Tested-by: SPDK CI Jenkins Community-CI: Mellanox Build Bot Community-CI: Broadcom CI Reviewed-by: Aleksey Marchuk Reviewed-by: Eugene Kochetov Reviewed-by: Jim Harris --- lib/nvme/nvme_ctrlr.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lib/nvme/nvme_ctrlr.c b/lib/nvme/nvme_ctrlr.c index 08f985c43..f5100867f 100644 --- a/lib/nvme/nvme_ctrlr.c +++ b/lib/nvme/nvme_ctrlr.c @@ -4588,11 +4588,6 @@ spdk_nvme_ctrlr_create_ns(struct spdk_nvme_ctrlr *ctrlr, struct spdk_nvme_ns_dat assert(nsid > 0); - res = nvme_ctrlr_construct_namespace(ctrlr, nsid); - if (res) { - return 0; - } - /* Return the namespace ID that was created */ return nsid; }