bdev/nvme: provide namespace UUID to bdev layer

Change-Id: Ie6e9620ba6bf7aa287ace03ec914c22db4928df1
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/404735
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Daniel Verkamp 2018-03-21 17:39:29 -07:00 committed by Jim Harris
parent 15bd6999db
commit 8f1c45b1b7

View File

@ -1104,6 +1104,7 @@ nvme_ctrlr_create_bdevs(struct nvme_ctrlr *nvme_ctrlr)
struct spdk_nvme_ctrlr *ctrlr = nvme_ctrlr->ctrlr;
struct spdk_nvme_ns *ns;
const struct spdk_nvme_ctrlr_data *cdata;
const struct spdk_uuid *uuid;
int ns_id, num_ns, rc;
int bdev_created = 0;
@ -1146,6 +1147,12 @@ nvme_ctrlr_create_bdevs(struct nvme_ctrlr *nvme_ctrlr)
bdev->disk.blocklen = spdk_nvme_ns_get_sector_size(ns);
bdev->disk.blockcnt = spdk_nvme_ns_get_num_sectors(ns);
bdev->disk.optimal_io_boundary = spdk_nvme_ns_get_optimal_io_boundary(ns);
uuid = spdk_nvme_ns_get_uuid(ns);
if (uuid != NULL) {
bdev->disk.uuid = *uuid;
}
bdev->disk.ctxt = bdev;
bdev->disk.fn_table = &nvmelib_fn_table;
bdev->disk.module = &nvme_if;