Commit e995690f authored by Shuhei Matsumoto's avatar Shuhei Matsumoto Committed by Tomasz Zawadzki
Browse files

bdev/nvme: nvme_bdev remembers if opal is enabled or not



This is helpful to simplify bdev_nvme_dump_info_json() when supporting
multipath.

Signed-off-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I7cf7712b8ee8ac6f15354a46dee2edbacbdeafcf
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5794


Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 885dd112
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1073,7 +1073,7 @@ bdev_nvme_dump_info_json(void *ctx, struct spdk_json_write_ctx *w)
	if (cdata->oacs.security) {
		spdk_json_write_named_object_begin(w, "security");

		spdk_json_write_named_bool(w, "opal", nvme_bdev_ctrlr->opal_dev ? true : false);
		spdk_json_write_named_bool(w, "opal", nvme_bdev->opal);

		spdk_json_write_object_end(w);
	}
@@ -1202,6 +1202,7 @@ nvme_bdev_create(struct nvme_bdev_ctrlr *nvme_bdev_ctrlr, struct nvme_bdev_ns *n
	}

	bdev->nvme_ns = nvme_ns;
	bdev->opal = nvme_bdev_ctrlr->opal_dev != NULL;

	rc = nvme_disk_create(&bdev->disk, nvme_bdev_ctrlr->name, nvme_bdev_ctrlr->ctrlr,
			      nvme_ns->ns, nvme_bdev_ctrlr->prchk_flags, bdev);
+1 −0
Original line number Diff line number Diff line
@@ -116,6 +116,7 @@ struct nvme_bdev_ctrlr {
struct nvme_bdev {
	struct spdk_bdev	disk;
	struct nvme_bdev_ns	*nvme_ns;
	bool			opal;
	TAILQ_ENTRY(nvme_bdev)	tailq;
};