bdev/nvme: rename 'active' flag to 'populated'
This will better match the recent renaming to the functions associated with this flag. Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: Ia7a0f3a50ae59b1d76d66443c91a98dc576f4d09 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475796 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
parent
62db72caaf
commit
7501235a35
@ -1029,7 +1029,7 @@ nvme_ctrlr_deactivate_namespace(struct nvme_bdev_ns *ns)
|
|||||||
spdk_bdev_unregister(&bdev->disk, NULL, NULL);
|
spdk_bdev_unregister(&bdev->disk, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
ns->active = false;
|
ns->populated = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -1044,7 +1044,7 @@ nvme_ctrlr_populate_namespaces(struct nvme_bdev_ctrlr *nvme_bdev_ctrlr)
|
|||||||
uint32_t nsid = i + 1;
|
uint32_t nsid = i + 1;
|
||||||
|
|
||||||
ns = nvme_bdev_ctrlr->namespaces[i];
|
ns = nvme_bdev_ctrlr->namespaces[i];
|
||||||
if (!ns->active && spdk_nvme_ctrlr_is_active_ns(ctrlr, nsid)) {
|
if (!ns->populated && spdk_nvme_ctrlr_is_active_ns(ctrlr, nsid)) {
|
||||||
ns->id = nsid;
|
ns->id = nsid;
|
||||||
ns->ctrlr = nvme_bdev_ctrlr;
|
ns->ctrlr = nvme_bdev_ctrlr;
|
||||||
if (spdk_nvme_ctrlr_is_ocssd_supported(ctrlr)) {
|
if (spdk_nvme_ctrlr_is_ocssd_supported(ctrlr)) {
|
||||||
@ -1057,13 +1057,13 @@ nvme_ctrlr_populate_namespaces(struct nvme_bdev_ctrlr *nvme_bdev_ctrlr)
|
|||||||
|
|
||||||
rc = nvme_ctrlr_populate_namespace(nvme_bdev_ctrlr, ns);
|
rc = nvme_ctrlr_populate_namespace(nvme_bdev_ctrlr, ns);
|
||||||
if (rc == 0) {
|
if (rc == 0) {
|
||||||
ns->active = true;
|
ns->populated = true;
|
||||||
} else {
|
} else {
|
||||||
memset(ns, 0, sizeof(*ns));
|
memset(ns, 0, sizeof(*ns));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ns->active && !spdk_nvme_ctrlr_is_active_ns(ctrlr, nsid)) {
|
if (ns->populated && !spdk_nvme_ctrlr_is_active_ns(ctrlr, nsid)) {
|
||||||
nvme_ctrlr_deactivate_namespace(ns);
|
nvme_ctrlr_deactivate_namespace(ns);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1225,9 +1225,9 @@ remove_cb(void *cb_ctx, struct spdk_nvme_ctrlr *ctrlr)
|
|||||||
uint32_t nsid = i + 1;
|
uint32_t nsid = i + 1;
|
||||||
|
|
||||||
ns = nvme_bdev_ctrlr->namespaces[nsid - 1];
|
ns = nvme_bdev_ctrlr->namespaces[nsid - 1];
|
||||||
if (ns->active) {
|
if (ns->populated) {
|
||||||
assert(ns->id == nsid);
|
assert(ns->id == nsid);
|
||||||
ns->active = false;
|
ns->populated = false;
|
||||||
TAILQ_FOREACH_SAFE(nvme_bdev, &ns->bdevs, tailq, tmp) {
|
TAILQ_FOREACH_SAFE(nvme_bdev, &ns->bdevs, tailq, tmp) {
|
||||||
spdk_bdev_unregister(&nvme_bdev->disk, NULL, NULL);
|
spdk_bdev_unregister(&nvme_bdev->disk, NULL, NULL);
|
||||||
}
|
}
|
||||||
@ -1378,7 +1378,7 @@ bdev_nvme_populate_namespaces(struct nvme_async_probe_ctx *ctx, spdk_bdev_create
|
|||||||
for (i = 0; i < nvme_bdev_ctrlr->num_ns; i++) {
|
for (i = 0; i < nvme_bdev_ctrlr->num_ns; i++) {
|
||||||
nsid = i + 1;
|
nsid = i + 1;
|
||||||
ns = nvme_bdev_ctrlr->namespaces[nsid - 1];
|
ns = nvme_bdev_ctrlr->namespaces[nsid - 1];
|
||||||
if (!ns->active) {
|
if (!ns->populated) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
assert(ns->id == nsid);
|
assert(ns->id == nsid);
|
||||||
|
@ -53,7 +53,7 @@ enum nvme_bdev_ns_type {
|
|||||||
struct nvme_bdev_ns {
|
struct nvme_bdev_ns {
|
||||||
uint32_t id;
|
uint32_t id;
|
||||||
enum nvme_bdev_ns_type type;
|
enum nvme_bdev_ns_type type;
|
||||||
bool active;
|
bool populated;
|
||||||
struct spdk_nvme_ns *ns;
|
struct spdk_nvme_ns *ns;
|
||||||
struct nvme_bdev_ctrlr *ctrlr;
|
struct nvme_bdev_ctrlr *ctrlr;
|
||||||
TAILQ_HEAD(, nvme_bdev) bdevs;
|
TAILQ_HEAD(, nvme_bdev) bdevs;
|
||||||
|
Loading…
Reference in New Issue
Block a user