summaryrefslogtreecommitdiff
path: root/drivers/nvdimm/label.h
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2015-05-30 12:36:02 -0400
committerDan Williams <dan.j.williams@intel.com>2015-06-24 21:24:10 -0400
commitf524bf271a5cf12a44253194abcf8b6688ff5b9d (patch)
treee477ae652183e73a6a3c6fc592046e255d2bfd15 /drivers/nvdimm/label.h
parent1b40e09a1232de537b193fa1b6b3ef16d3a1e397 (diff)
downloadlinux-rpi-f524bf271a5cf12a44253194abcf8b6688ff5b9d.tar.gz
linux-rpi-f524bf271a5cf12a44253194abcf8b6688ff5b9d.tar.bz2
linux-rpi-f524bf271a5cf12a44253194abcf8b6688ff5b9d.zip
libnvdimm: write pmem label set
After 'uuid', 'size', and optionally 'alt_name' have been set to valid values the labels on the dimms can be updated. Write procedure is: 1/ Allocate and write new labels in the "next" index 2/ Free the old labels in the working copy 3/ Write the bitmap and the label space on the dimm 4/ Write the index to make the update valid Label ranges directly mirror the dpa resource values for the given label_id of the namespace. Cc: Greg KH <gregkh@linuxfoundation.org> Cc: Neil Brown <neilb@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/nvdimm/label.h')
-rw-r--r--drivers/nvdimm/label.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/nvdimm/label.h b/drivers/nvdimm/label.h
index 8ee1376526c7..6d376be31937 100644
--- a/drivers/nvdimm/label.h
+++ b/drivers/nvdimm/label.h
@@ -34,6 +34,7 @@ enum {
BTTINFO_MAJOR_VERSION = 1,
ND_LABEL_MIN_SIZE = 512 * 129, /* see sizeof_namespace_index() */
ND_LABEL_ID_SIZE = 50,
+ ND_NSINDEX_INIT = 0x1,
};
static const char NSINDEX_SIGNATURE[] = "NAMESPACE_INDEX\0";
@@ -127,4 +128,9 @@ void nd_label_copy(struct nvdimm_drvdata *ndd, struct nd_namespace_index *dst,
size_t sizeof_namespace_index(struct nvdimm_drvdata *ndd);
int nd_label_active_count(struct nvdimm_drvdata *ndd);
struct nd_namespace_label *nd_label_active(struct nvdimm_drvdata *ndd, int n);
+u32 nd_label_nfree(struct nvdimm_drvdata *ndd);
+struct nd_region;
+struct nd_namespace_pmem;
+int nd_pmem_namespace_label_update(struct nd_region *nd_region,
+ struct nd_namespace_pmem *nspm, resource_size_t size);
#endif /* __LABEL_H__ */