From 1b40e09a1232de537b193fa1b6b3ef16d3a1e397 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 1 May 2015 13:34:01 -0400 Subject: libnvdimm: blk labels and namespace instantiation A blk label set describes a namespace comprised of one or more discontiguous dpa ranges on a single dimm. They may alias with one or more pmem interleave sets that include the given dimm. This is the runtime/volatile configuration infrastructure for sysfs manipulation of 'alt_name', 'uuid', 'size', and 'sector_size'. A later patch will make these settings persistent by writing back the label(s). Unlike pmem namespaces, multiple blk namespaces can be created per region. Once a blk namespace has been created a new seed device (unconfigured child of a parent blk region) is instantiated. As long as a region has 'available_size' != 0 new child namespaces may be created. Cc: Greg KH Cc: Neil Brown Acked-by: Christoph Hellwig Signed-off-by: Dan Williams --- drivers/nvdimm/nd.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers/nvdimm/nd.h') diff --git a/drivers/nvdimm/nd.h b/drivers/nvdimm/nd.h index 03e610cd9f43..9b021b626202 100644 --- a/drivers/nvdimm/nd.h +++ b/drivers/nvdimm/nd.h @@ -73,6 +73,7 @@ static inline struct nd_namespace_index *to_next_namespace_index( struct nd_region { struct device dev; + struct ida ns_ida; struct device *ns_seed; u16 ndr_mappings; u64 ndr_size; @@ -102,6 +103,10 @@ void nd_device_register(struct device *dev); void nd_device_unregister(struct device *dev, enum nd_async_mode mode); int nd_uuid_store(struct device *dev, u8 **uuid_out, const char *buf, size_t len); +ssize_t nd_sector_size_show(unsigned long current_lbasize, + const unsigned long *supported, char *buf); +ssize_t nd_sector_size_store(struct device *dev, const char *buf, + unsigned long *current_lbasize, const unsigned long *supported); int __init nvdimm_init(void); int __init nd_region_init(void); void nvdimm_exit(void); -- cgit v1.2.3