From f524bf271a5cf12a44253194abcf8b6688ff5b9d Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sat, 30 May 2015 12:36:02 -0400 Subject: 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 Cc: Neil Brown Acked-by: Christoph Hellwig Signed-off-by: Dan Williams --- drivers/nvdimm/label.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers/nvdimm/label.h') diff --git a/drivers/nvdimm/label.h b/drivers/nvdimm/label.h index 8ee1376..6d376be 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__ */ -- cgit v1.1