bdev/ftl: Initialize a nvme_bdev_ctrlr name
Change-Id: I9d7de9a41762fd6e9484a289eda076c352310eda Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/447433 Reviewed-by: Maciej Szwed <maciej.szwed@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
136c3fb461
commit
6cc1b3630f
@ -134,6 +134,14 @@ bdev_ftl_add_ctrlr(struct spdk_nvme_ctrlr *ctrlr, const struct spdk_nvme_transpo
|
||||
ftl_ctrlr->trid = *trid;
|
||||
ftl_ctrlr->ref = 1;
|
||||
|
||||
ftl_ctrlr->name = spdk_sprintf_alloc("NVMe_%s", trid->traddr);
|
||||
if (!ftl_ctrlr->name) {
|
||||
SPDK_ERRLOG("Unable to allocate memory for bdev controller name.\n");
|
||||
free(ftl_ctrlr);
|
||||
ftl_ctrlr = NULL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
TAILQ_INSERT_HEAD(&g_nvme_bdev_ctrlrs, ftl_ctrlr, tailq);
|
||||
}
|
||||
out:
|
||||
@ -153,6 +161,7 @@ bdev_ftl_remove_ctrlr(struct nvme_bdev_ctrlr *ctrlr)
|
||||
}
|
||||
|
||||
TAILQ_REMOVE(&g_nvme_bdev_ctrlrs, ctrlr, tailq);
|
||||
free(ctrlr->name);
|
||||
free(ctrlr);
|
||||
}
|
||||
out:
|
||||
|
Loading…
x
Reference in New Issue
Block a user