diff options
author | Dan Williams <dan.j.williams@intel.com> | 2017-06-06 11:10:51 -0700 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2017-06-15 14:31:40 -0700 |
commit | faec6f8a1cd2c44e439de35ab3328c5cf7bf52d8 (patch) | |
tree | 140523684286a8a5283b54ec1e1d4e1a258fcc04 /drivers/nvdimm/label.c | |
parent | f979b13c3cc51584882bffa32965f34e5afa3b9b (diff) |
libnvdimm, label: populate the type_guid property for v1.2 namespaces
The type_guid refers to the "Address Range Type GUID" for the region
backing a namespace as defined the ACPI NFIT (NVDIMM Firmware Interface
Table). This 'type' identifier specifies an access mechanism for the
given namespace. This capability replaces the confusing usage of the
'NSLABEL_FLAG_LOCAL' flag to indicate a block-aperture-mode namespace.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/nvdimm/label.c')
-rw-r--r-- | drivers/nvdimm/label.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/nvdimm/label.c b/drivers/nvdimm/label.c index 1aacd4866c76..d8b87d3a0ebe 100644 --- a/drivers/nvdimm/label.c +++ b/drivers/nvdimm/label.c @@ -553,6 +553,7 @@ static int __pmem_label_update(struct nd_region *nd_region, struct nd_mapping *nd_mapping, struct nd_namespace_pmem *nspm, int pos) { + struct nd_interleave_set *nd_set = nd_region->nd_set; struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); struct nd_label_ent *label_ent, *victim = NULL; struct nd_namespace_label *nd_label; @@ -597,6 +598,8 @@ static int __pmem_label_update(struct nd_region *nd_region, nd_label->rawsize = __cpu_to_le64(resource_size(res)); nd_label->dpa = __cpu_to_le64(res->start); nd_label->slot = __cpu_to_le32(slot); + if (namespace_label_has(ndd, type_guid)) + guid_copy(&nd_label->type_guid, &nd_set->type_guid); nd_dbg_dpa(nd_region, ndd, res, "%s\n", __func__); /* update label */ @@ -684,6 +687,7 @@ static int __blk_label_update(struct nd_region *nd_region, int num_labels) { int i, alloc, victims, nfree, old_num_resources, nlabel, rc = -ENXIO; + struct nd_interleave_set *nd_set = nd_region->nd_set; struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); struct nd_namespace_label *nd_label; struct nd_label_ent *label_ent, *e; @@ -788,6 +792,8 @@ static int __blk_label_update(struct nd_region *nd_region, nd_label->rawsize = __cpu_to_le64(resource_size(res)); nd_label->lbasize = __cpu_to_le64(nsblk->lbasize); nd_label->slot = __cpu_to_le32(slot); + if (namespace_label_has(ndd, type_guid)) + guid_copy(&nd_label->type_guid, &nd_set->type_guid); /* update label */ offset = nd_label_offset(ndd, nd_label); |