libnvdimm/labels: Introduce the concept of multi-range namespace labels
authorDan Williams <dan.j.williams@intel.com>
Thu, 9 Sep 2021 05:11:48 +0000 (22:11 -0700)
committerDan Williams <dan.j.williams@intel.com>
Tue, 21 Sep 2021 20:44:55 +0000 (13:44 -0700)
commit42e192aa9891f196bc1adaaeab9a23d975618e5e
tree60541147ce5f934c2d2a25aea0e0b7376357f8de
parent8172db92527c936c638b52274fbd06a0a624a56b
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>
drivers/nvdimm/label.c
drivers/nvdimm/nd.h