aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/nvdimm/label.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2021-09-08 22:11:48 -0700
committerDan Williams <dan.j.williams@intel.com>2021-09-21 13:44:55 -0700
commit42e192aa9891f196bc1adaaeab9a23d975618e5e (patch)
tree60541147ce5f934c2d2a25aea0e0b7376357f8de /drivers/nvdimm/label.c
parentlibnvdimm/label: Add a helper for nlabel validation (diff)
downloadlinux-dev-42e192aa9891f196bc1adaaeab9a23d975618e5e.tar.xz
linux-dev-42e192aa9891f196bc1adaaeab9a23d975618e5e.zip
libnvdimm/labels: Introduce the concept of multi-range namespace labels
The CXL specification defines a mechanism for namespaces to be comprised of multiple dis-contiguous ranges. Introduce that concept to the legacy NVDIMM namespace implementation with a new nsl_set_nrange() helper, that sets the number of ranges to 1. Once the NVDIMM subsystem supports CXL labels and updates its namespace capacity provisioning for dis-contiguous support nsl_set_nrange() can be updated, but in the meantime CXL label validation requires nrange be non-zero. Reported-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Link: https://lore.kernel.org/r/163116430804.2460985.5482188351381597529.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/nvdimm/label.c')
-rw-r--r--drivers/nvdimm/label.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/nvdimm/label.c b/drivers/nvdimm/label.c
index e7fdb718ebf0..7832b190efd7 100644
--- a/drivers/nvdimm/label.c
+++ b/drivers/nvdimm/label.c
@@ -856,6 +856,7 @@ static int __pmem_label_update(struct nd_region *nd_region,
nsl_set_name(ndd, nd_label, nspm->alt_name);
nsl_set_flags(ndd, nd_label, flags);
nsl_set_nlabel(ndd, nd_label, nd_region->ndr_mappings);
+ nsl_set_nrange(ndd, nd_label, 1);
nsl_set_position(ndd, nd_label, pos);
nsl_set_isetcookie(ndd, nd_label, cookie);
nsl_set_rawsize(ndd, nd_label, resource_size(res));