Skip to content

Commit f88b3ec

Browse files
weiny2davejiang
authored andcommitted
dax: Document struct dev_dax_range
The device DAX structure is being enhanced to track additional DCD information. Specifically the range tuple needs additional parameters. The current range tuple is not fully documented and is large enough to warrant its own definition. Separate the struct dax_dev_range definition and document it prior to adding information for DC. Suggested-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Ira Weiny <ira.weiny@intel.com> Link: https://patch.msgid.link/20241107-dcd-type2-upstream-v7-3-56a84e66bc36@intel.com Signed-off-by: Dave Jiang <dave.jiang@intel.com>
1 parent d62e2ed commit f88b3ec

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

drivers/dax/dax-private.h

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,30 @@ struct dax_region {
4040
struct device *youngest;
4141
};
4242

43+
/**
44+
* struct dax_mapping - device to display mapping range attributes
45+
* @dev: device representing this range
46+
* @range_id: index within dev_dax ranges array
47+
* @id: ida of this mapping
48+
*/
4349
struct dax_mapping {
4450
struct device dev;
4551
int range_id;
4652
int id;
4753
};
4854

55+
/**
56+
* struct dev_dax_range - tuple represenging a range of memory used by dev_dax
57+
* @pgoff: page offset
58+
* @range: resource-span
59+
* @mapping: reference to the dax_mapping for this range
60+
*/
61+
struct dev_dax_range {
62+
unsigned long pgoff;
63+
struct range range;
64+
struct dax_mapping *mapping;
65+
};
66+
4967
/**
5068
* struct dev_dax - instance data for a subdivision of a dax region, and
5169
* data while the device is activated in the driver.
@@ -58,7 +76,7 @@ struct dax_mapping {
5876
* @dev - device core
5977
* @pgmap - pgmap for memmap setup / lifetime (driver owned)
6078
* @nr_range: size of @ranges
61-
* @ranges: resource-span + pgoff tuples for the instance
79+
* @ranges: range tuples of memory used
6280
*/
6381
struct dev_dax {
6482
struct dax_region *region;
@@ -72,11 +90,7 @@ struct dev_dax {
7290
struct dev_pagemap *pgmap;
7391
bool memmap_on_memory;
7492
int nr_range;
75-
struct dev_dax_range {
76-
unsigned long pgoff;
77-
struct range range;
78-
struct dax_mapping *mapping;
79-
} *ranges;
93+
struct dev_dax_range *ranges;
8094
};
8195

8296
/*

0 commit comments

Comments
 (0)