libnvdimm: pmem label sets and namespace instantiation.
[deliverable/linux.git] / include / linux / nd.h
index da70e9962197a109eb42d44485c719b61933538e..255c38a8308394b58f5913366d834176a10f0270 100644 (file)
@@ -28,16 +28,40 @@ static inline struct nd_device_driver *to_nd_device_driver(
        return container_of(drv, struct nd_device_driver, drv);
 };
 
+/**
+ * struct nd_namespace_io - infrastructure for loading an nd_pmem instance
+ * @dev: namespace device created by the nd region driver
+ * @res: struct resource conversion of a NFIT SPA table
+ */
 struct nd_namespace_io {
        struct device dev;
        struct resource res;
 };
 
+/**
+ * struct nd_namespace_pmem - namespace device for dimm-backed interleaved memory
+ * @nsio: device and system physical address range to drive
+ * @alt_name: namespace name supplied in the dimm label
+ * @uuid: namespace name supplied in the dimm label
+ */
+struct nd_namespace_pmem {
+       struct nd_namespace_io nsio;
+       char *alt_name;
+       u8 *uuid;
+};
+
 static inline struct nd_namespace_io *to_nd_namespace_io(struct device *dev)
 {
        return container_of(dev, struct nd_namespace_io, dev);
 }
 
+static inline struct nd_namespace_pmem *to_nd_namespace_pmem(struct device *dev)
+{
+       struct nd_namespace_io *nsio = to_nd_namespace_io(dev);
+
+       return container_of(nsio, struct nd_namespace_pmem, nsio);
+}
+
 #define MODULE_ALIAS_ND_DEVICE(type) \
        MODULE_ALIAS("nd:t" __stringify(type) "*")
 #define ND_DEVICE_MODALIAS_FMT "nd:t%d"
This page took 0.039534 seconds and 5 git commands to generate.