summaryrefslogtreecommitdiff
path: root/drivers/dax/fsdev.c
diff options
context:
space:
mode:
authorJohn Groves <john@groves.net>2026-03-27 21:04:44 +0000
committerIra Weiny <ira.weiny@intel.com>2026-03-30 08:20:47 -0500
commit759455848df0b9ac3acabdbedcdc4a55af67935f (patch)
treeb9c269048951ce30adff16d9cff1a82e76f91103 /drivers/dax/fsdev.c
parentd5406bd458b0ac10b1301a4d5801d85c8f648637 (diff)
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>
Diffstat (limited to 'drivers/dax/fsdev.c')
-rw-r--r--drivers/dax/fsdev.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/dax/fsdev.c b/drivers/dax/fsdev.c
index 8b5c6976ad17..c75478d3d548 100644
--- a/drivers/dax/fsdev.c
+++ b/drivers/dax/fsdev.c
@@ -121,6 +121,7 @@ static int fsdev_dax_probe(struct dev_dax *dev_dax)
struct device *dev = &dev_dax->dev;
struct dev_pagemap *pgmap;
struct inode *inode;
+ u64 data_offset = 0;
struct cdev *cdev;
void *addr;
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) {
u64 phys = dev_dax->ranges[0].range.start;
u64 pgmap_phys = dev_dax->pgmap[0].range.start;
- u64 data_offset = 0;
if (!WARN_ON(pgmap_phys > 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",
__func__, phys, pgmap_phys, data_offset);
}
+ dev_dax->virt_addr = addr + data_offset;
inode = dax_inode(dax_dev);
cdev = inode->i_cdev;