diff options
author | Dan Williams <dan.j.williams@intel.com> | 2015-05-30 19:35:36 +0300 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2015-06-25 04:24:10 +0300 |
commit | 0ba1c634892b3590779803a701bcb82e8c32cc7a (patch) | |
tree | c23d1c952ec837729700b5e3c34cdb42a073b055 /drivers/nvdimm/label.h | |
parent | f524bf271a5cf12a44253194abcf8b6688ff5b9d (diff) | |
download | linux-0ba1c634892b3590779803a701bcb82e8c32cc7a.tar.xz |
libnvdimm: write blk label set
After 'uuid', 'size', 'sector_size', and optionally 'alt_name' have been
set to valid values the labels on the dimm can be updated. The
difference with the pmem case is that blk namespaces are limited to one
dimm and can cover discontiguous ranges in dpa space.
Also, after allocating label slots, it is useful for userspace to know
how many slots are left. Export this information in sysfs.
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.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/nvdimm/label.h b/drivers/nvdimm/label.h index 6d376be31937..a59ef6eef2a3 100644 --- a/drivers/nvdimm/label.h +++ b/drivers/nvdimm/label.h @@ -128,9 +128,14 @@ 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_alloc_slot(struct nvdimm_drvdata *ndd); +bool nd_label_free_slot(struct nvdimm_drvdata *ndd, u32 slot); u32 nd_label_nfree(struct nvdimm_drvdata *ndd); struct nd_region; struct nd_namespace_pmem; +struct nd_namespace_blk; int nd_pmem_namespace_label_update(struct nd_region *nd_region, struct nd_namespace_pmem *nspm, resource_size_t size); +int nd_blk_namespace_label_update(struct nd_region *nd_region, + struct nd_namespace_blk *nsblk, resource_size_t size); #endif /* __LABEL_H__ */ |