Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

John Groves and committed by
Ira Weiny
75945584 d5406bd4

+4 -1
+2
drivers/dax/dax-private.h
··· 69 69 * data while the device is activated in the driver. 70 70 * @region: parent region 71 71 * @dax_dev: core dax functionality 72 + * @virt_addr: kva from memremap; used by fsdev_dax 72 73 * @align: alignment of this instance 73 74 * @target_node: effective numa node if dev_dax memory range is onlined 74 75 * @dyn_id: is this a dynamic or statically created instance ··· 84 83 struct dev_dax { 85 84 struct dax_region *region; 86 85 struct dax_device *dax_dev; 86 + void *virt_addr; 87 87 unsigned int align; 88 88 int target_node; 89 89 bool dyn_id;
+2 -1
drivers/dax/fsdev.c
··· 121 121 struct device *dev = &dev_dax->dev; 122 122 struct dev_pagemap *pgmap; 123 123 struct inode *inode; 124 + u64 data_offset = 0; 124 125 struct cdev *cdev; 125 126 void *addr; 126 127 int rc, i; ··· 197 196 if (pgmap->range.start != dev_dax->ranges[0].range.start) { 198 197 u64 phys = dev_dax->ranges[0].range.start; 199 198 u64 pgmap_phys = dev_dax->pgmap[0].range.start; 200 - u64 data_offset = 0; 201 199 202 200 if (!WARN_ON(pgmap_phys > phys)) 203 201 data_offset = phys - pgmap_phys; ··· 204 204 pr_debug("%s: offset detected phys=%llx pgmap_phys=%llx offset=%llx\n", 205 205 __func__, phys, pgmap_phys, data_offset); 206 206 } 207 + dev_dax->virt_addr = addr + data_offset; 207 208 208 209 inode = dax_inode(dax_dev); 209 210 cdev = inode->i_cdev;