aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dax/dax-private.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/dax/dax-private.h')
-rw-r--r--drivers/dax/dax-private.h34
1 files changed, 24 insertions, 10 deletions
diff --git a/drivers/dax/dax-private.h b/drivers/dax/dax-private.h
index b6fc4f04636d..a45612148ca0 100644
--- a/drivers/dax/dax-private.h
+++ b/drivers/dax/dax-private.h
@@ -16,10 +16,17 @@
16#include <linux/device.h> 16#include <linux/device.h>
17#include <linux/cdev.h> 17#include <linux/cdev.h>
18 18
19/* private routines between core files */
20struct dax_device;
21struct dax_device *inode_dax(struct inode *inode);
22struct inode *dax_inode(struct dax_device *dax_dev);
23int dax_bus_init(void);
24void dax_bus_exit(void);
25
19/** 26/**
20 * struct dax_region - mapping infrastructure for dax devices 27 * struct dax_region - mapping infrastructure for dax devices
21 * @id: kernel-wide unique region for a memory range 28 * @id: kernel-wide unique region for a memory range
22 * @base: linear address corresponding to @res 29 * @target_node: effective numa node if this memory range is onlined
23 * @kref: to pin while other agents have a need to do lookups 30 * @kref: to pin while other agents have a need to do lookups
24 * @dev: parent device backing this region 31 * @dev: parent device backing this region
25 * @align: allocation and mapping alignment for child dax devices 32 * @align: allocation and mapping alignment for child dax devices
@@ -28,8 +35,7 @@
28 */ 35 */
29struct dax_region { 36struct dax_region {
30 int id; 37 int id;
31 struct ida ida; 38 int target_node;
32 void *base;
33 struct kref kref; 39 struct kref kref;
34 struct device *dev; 40 struct device *dev;
35 unsigned int align; 41 unsigned int align;
@@ -38,20 +44,28 @@ struct dax_region {
38}; 44};
39 45
40/** 46/**
41 * struct dev_dax - instance data for a subdivision of a dax region 47 * struct dev_dax - instance data for a subdivision of a dax region, and
48 * data while the device is activated in the driver.
42 * @region - parent region 49 * @region - parent region
43 * @dax_dev - core dax functionality 50 * @dax_dev - core dax functionality
51 * @target_node: effective numa node if dev_dax memory range is onlined
44 * @dev - device core 52 * @dev - device core
45 * @id - child id in the region 53 * @pgmap - pgmap for memmap setup / lifetime (driver owned)
46 * @num_resources - number of physical address extents in this device 54 * @ref: pgmap reference count (driver owned)
47 * @res - array of physical address ranges 55 * @cmp: @ref final put completion (driver owned)
48 */ 56 */
49struct dev_dax { 57struct dev_dax {
50 struct dax_region *region; 58 struct dax_region *region;
51 struct dax_device *dax_dev; 59 struct dax_device *dax_dev;
60 int target_node;
52 struct device dev; 61 struct device dev;
53 int id; 62 struct dev_pagemap pgmap;
54 int num_resources; 63 struct percpu_ref ref;
55 struct resource res[0]; 64 struct completion cmp;
56}; 65};
66
67static inline struct dev_dax *to_dev_dax(struct device *dev)
68{
69 return container_of(dev, struct dev_dax, dev);
70}
57#endif 71#endif