summaryrefslogtreecommitdiffstats
path: root/drivers/nvdimm/nd.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/nvdimm/nd.h')
-rw-r--r--drivers/nvdimm/nd.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/nvdimm/nd.h b/drivers/nvdimm/nd.h
index 6c36509662e4..46910b8f32b1 100644
--- a/drivers/nvdimm/nd.h
+++ b/drivers/nvdimm/nd.h
@@ -101,10 +101,12 @@ struct nd_region {
101 struct ida ns_ida; 101 struct ida ns_ida;
102 struct ida btt_ida; 102 struct ida btt_ida;
103 struct ida pfn_ida; 103 struct ida pfn_ida;
104 struct ida dax_ida;
104 unsigned long flags; 105 unsigned long flags;
105 struct device *ns_seed; 106 struct device *ns_seed;
106 struct device *btt_seed; 107 struct device *btt_seed;
107 struct device *pfn_seed; 108 struct device *pfn_seed;
109 struct device *dax_seed;
108 u16 ndr_mappings; 110 u16 ndr_mappings;
109 u64 ndr_size; 111 u64 ndr_size;
110 u64 ndr_start; 112 u64 ndr_start;
@@ -161,6 +163,10 @@ struct nd_pfn {
161 struct nd_namespace_common *ndns; 163 struct nd_namespace_common *ndns;
162}; 164};
163 165
166struct nd_dax {
167 struct nd_pfn nd_pfn;
168};
169
164enum nd_async_mode { 170enum nd_async_mode {
165 ND_SYNC, 171 ND_SYNC,
166 ND_ASYNC, 172 ND_ASYNC,
@@ -224,7 +230,10 @@ struct nd_pfn *to_nd_pfn(struct device *dev);
224int nd_pfn_probe(struct device *dev, struct nd_namespace_common *ndns); 230int nd_pfn_probe(struct device *dev, struct nd_namespace_common *ndns);
225bool is_nd_pfn(struct device *dev); 231bool is_nd_pfn(struct device *dev);
226struct device *nd_pfn_create(struct nd_region *nd_region); 232struct device *nd_pfn_create(struct nd_region *nd_region);
233struct device *nd_pfn_devinit(struct nd_pfn *nd_pfn,
234 struct nd_namespace_common *ndns);
227int nd_pfn_validate(struct nd_pfn *nd_pfn); 235int nd_pfn_validate(struct nd_pfn *nd_pfn);
236extern struct attribute_group nd_pfn_attribute_group;
228#else 237#else
229static inline int nd_pfn_probe(struct device *dev, 238static inline int nd_pfn_probe(struct device *dev,
230 struct nd_namespace_common *ndns) 239 struct nd_namespace_common *ndns)
@@ -248,6 +257,22 @@ static inline int nd_pfn_validate(struct nd_pfn *nd_pfn)
248} 257}
249#endif 258#endif
250 259
260struct nd_dax *to_nd_dax(struct device *dev);
261#if IS_ENABLED(CONFIG_NVDIMM_DAX)
262bool is_nd_dax(struct device *dev);
263struct device *nd_dax_create(struct nd_region *nd_region);
264#else
265static inline bool is_nd_dax(struct device *dev)
266{
267 return false;
268}
269
270static inline struct device *nd_dax_create(struct nd_region *nd_region)
271{
272 return NULL;
273}
274#endif
275
251struct nd_region *to_nd_region(struct device *dev); 276struct nd_region *to_nd_region(struct device *dev);
252int nd_region_to_nstype(struct nd_region *nd_region); 277int nd_region_to_nstype(struct nd_region *nd_region);
253int nd_region_register_namespaces(struct nd_region *nd_region, int *err); 278int nd_region_register_namespaces(struct nd_region *nd_region, int *err);