mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 22:14:03 +02:00
dax: Save the kva from memremap
Save the kva from memremap because we need it for iomap rw support. Prior to famfs, there were no iomap users of /dev/dax - so the virtual address from memremap was not needed. Reviewed-by: Ira Weiny <ira.weiny@intel.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com> Signed-off-by: John Groves <john@groves.net> Link: https://patch.msgid.link/0100019d311d1d08-dd372cb9-5934-43b8-bef8-089660d04a81-000000@email.amazonses.com Signed-off-by: Ira Weiny <ira.weiny@intel.com>
This commit is contained in:
parent
d5406bd458
commit
759455848d
|
|
@ -69,6 +69,7 @@ struct dev_dax_range {
|
||||||
* data while the device is activated in the driver.
|
* data while the device is activated in the driver.
|
||||||
* @region: parent region
|
* @region: parent region
|
||||||
* @dax_dev: core dax functionality
|
* @dax_dev: core dax functionality
|
||||||
|
* @virt_addr: kva from memremap; used by fsdev_dax
|
||||||
* @align: alignment of this instance
|
* @align: alignment of this instance
|
||||||
* @target_node: effective numa node if dev_dax memory range is onlined
|
* @target_node: effective numa node if dev_dax memory range is onlined
|
||||||
* @dyn_id: is this a dynamic or statically created instance
|
* @dyn_id: is this a dynamic or statically created instance
|
||||||
|
|
@ -83,6 +84,7 @@ struct dev_dax_range {
|
||||||
struct dev_dax {
|
struct dev_dax {
|
||||||
struct dax_region *region;
|
struct dax_region *region;
|
||||||
struct dax_device *dax_dev;
|
struct dax_device *dax_dev;
|
||||||
|
void *virt_addr;
|
||||||
unsigned int align;
|
unsigned int align;
|
||||||
int target_node;
|
int target_node;
|
||||||
bool dyn_id;
|
bool dyn_id;
|
||||||
|
|
|
||||||
|
|
@ -121,6 +121,7 @@ static int fsdev_dax_probe(struct dev_dax *dev_dax)
|
||||||
struct device *dev = &dev_dax->dev;
|
struct device *dev = &dev_dax->dev;
|
||||||
struct dev_pagemap *pgmap;
|
struct dev_pagemap *pgmap;
|
||||||
struct inode *inode;
|
struct inode *inode;
|
||||||
|
u64 data_offset = 0;
|
||||||
struct cdev *cdev;
|
struct cdev *cdev;
|
||||||
void *addr;
|
void *addr;
|
||||||
int rc, i;
|
int rc, i;
|
||||||
|
|
@ -196,7 +197,6 @@ static int fsdev_dax_probe(struct dev_dax *dev_dax)
|
||||||
if (pgmap->range.start != dev_dax->ranges[0].range.start) {
|
if (pgmap->range.start != dev_dax->ranges[0].range.start) {
|
||||||
u64 phys = dev_dax->ranges[0].range.start;
|
u64 phys = dev_dax->ranges[0].range.start;
|
||||||
u64 pgmap_phys = dev_dax->pgmap[0].range.start;
|
u64 pgmap_phys = dev_dax->pgmap[0].range.start;
|
||||||
u64 data_offset = 0;
|
|
||||||
|
|
||||||
if (!WARN_ON(pgmap_phys > phys))
|
if (!WARN_ON(pgmap_phys > phys))
|
||||||
data_offset = phys - pgmap_phys;
|
data_offset = phys - pgmap_phys;
|
||||||
|
|
@ -204,6 +204,7 @@ static int fsdev_dax_probe(struct dev_dax *dev_dax)
|
||||||
pr_debug("%s: offset detected phys=%llx pgmap_phys=%llx offset=%llx\n",
|
pr_debug("%s: offset detected phys=%llx pgmap_phys=%llx offset=%llx\n",
|
||||||
__func__, phys, pgmap_phys, data_offset);
|
__func__, phys, pgmap_phys, data_offset);
|
||||||
}
|
}
|
||||||
|
dev_dax->virt_addr = addr + data_offset;
|
||||||
|
|
||||||
inode = dax_inode(dax_dev);
|
inode = dax_inode(dax_dev);
|
||||||
cdev = inode->i_cdev;
|
cdev = inode->i_cdev;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user