summaryrefslogtreecommitdiffstats
path: root/drivers/nvdimm/nd.h
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2017-08-29 18:28:18 -0700
committerDan Williams <dan.j.williams@intel.com>2017-08-29 18:28:18 -0700
commit02881768695da29772f6f9e0d857a8637c6b0e90 (patch)
tree4e8457f9a47764d13b0d1d17ae59dea07a1076fa /drivers/nvdimm/nd.h
parentf13d2b61e59cbdd813be7639eb85bfbf99593ac0 (diff)
downloadlinux-02881768695da29772f6f9e0d857a8637c6b0e90.tar.gz
linux-02881768695da29772f6f9e0d857a8637c6b0e90.tar.bz2
linux-02881768695da29772f6f9e0d857a8637c6b0e90.zip
libnvdimm, label: fix index block size calculation
The old calculation assumed that the label space was 128k and the label size is 128. With v1.2 labels where the label size is 256 this calculation will return zero. We are saved by the fact that the nsindex_size is always pre-initialized from a previous 128 byte assumption and we are lucky that the index sizes turn out the same. Fix this going forward in case we start encountering different geometries of label areas besides 128k. Since the label size can change from one call to the next, drop the caching of nsindex_size. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/nvdimm/nd.h')
-rw-r--r--drivers/nvdimm/nd.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvdimm/nd.h b/drivers/nvdimm/nd.h
index 251c7e6d2588..023fc93e21a5 100644
--- a/drivers/nvdimm/nd.h
+++ b/drivers/nvdimm/nd.h
@@ -42,7 +42,7 @@ struct nd_poison {
struct nvdimm_drvdata {
struct device *dev;
- int nsindex_size, nslabel_size;
+ int nslabel_size;
struct nd_cmd_get_config_size nsarea;
void *data;
int ns_current, ns_next;