diff options
Diffstat (limited to 'drivers/nvdimm/nd.h')
-rw-r--r-- | drivers/nvdimm/nd.h | 25 |
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 | ||
166 | struct nd_dax { | ||
167 | struct nd_pfn nd_pfn; | ||
168 | }; | ||
169 | |||
164 | enum nd_async_mode { | 170 | enum 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); | |||
224 | int nd_pfn_probe(struct device *dev, struct nd_namespace_common *ndns); | 230 | int nd_pfn_probe(struct device *dev, struct nd_namespace_common *ndns); |
225 | bool is_nd_pfn(struct device *dev); | 231 | bool is_nd_pfn(struct device *dev); |
226 | struct device *nd_pfn_create(struct nd_region *nd_region); | 232 | struct device *nd_pfn_create(struct nd_region *nd_region); |
233 | struct device *nd_pfn_devinit(struct nd_pfn *nd_pfn, | ||
234 | struct nd_namespace_common *ndns); | ||
227 | int nd_pfn_validate(struct nd_pfn *nd_pfn); | 235 | int nd_pfn_validate(struct nd_pfn *nd_pfn); |
236 | extern struct attribute_group nd_pfn_attribute_group; | ||
228 | #else | 237 | #else |
229 | static inline int nd_pfn_probe(struct device *dev, | 238 | static 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 | ||
260 | struct nd_dax *to_nd_dax(struct device *dev); | ||
261 | #if IS_ENABLED(CONFIG_NVDIMM_DAX) | ||
262 | bool is_nd_dax(struct device *dev); | ||
263 | struct device *nd_dax_create(struct nd_region *nd_region); | ||
264 | #else | ||
265 | static inline bool is_nd_dax(struct device *dev) | ||
266 | { | ||
267 | return false; | ||
268 | } | ||
269 | |||
270 | static inline struct device *nd_dax_create(struct nd_region *nd_region) | ||
271 | { | ||
272 | return NULL; | ||
273 | } | ||
274 | #endif | ||
275 | |||
251 | struct nd_region *to_nd_region(struct device *dev); | 276 | struct nd_region *to_nd_region(struct device *dev); |
252 | int nd_region_to_nstype(struct nd_region *nd_region); | 277 | int nd_region_to_nstype(struct nd_region *nd_region); |
253 | int nd_region_register_namespaces(struct nd_region *nd_region, int *err); | 278 | int nd_region_register_namespaces(struct nd_region *nd_region, int *err); |