summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2017-07-14 16:54:50 -0400
committerDan Williams <dan.j.williams@intel.com>2019-01-07 00:24:46 -0500
commit753a0850e707e9a8c5861356222f9b9e4eba7945 (patch)
tree8c7e75e158b5debb5d31cdfce8e86d173e55084a /tools
parent93694f9630b0ed29cda61df58e480dcb34ef52fd (diff)
device-dax: Remove multi-resource infrastructure
The multi-resource implementation anticipated discontiguous sub-division support. That has not yet materialized, delete the infrastructure and related code. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/nvdimm/dax-dev.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/tools/testing/nvdimm/dax-dev.c b/tools/testing/nvdimm/dax-dev.c
index 36ee3d8797c3..f36e708265b8 100644
--- a/tools/testing/nvdimm/dax-dev.c
+++ b/tools/testing/nvdimm/dax-dev.c
@@ -17,20 +17,11 @@
17phys_addr_t dax_pgoff_to_phys(struct dev_dax *dev_dax, pgoff_t pgoff, 17phys_addr_t dax_pgoff_to_phys(struct dev_dax *dev_dax, pgoff_t pgoff,
18 unsigned long size) 18 unsigned long size)
19{ 19{
20 struct resource *res; 20 struct resource *res = &dev_dax->region->res;
21 phys_addr_t addr; 21 phys_addr_t addr;
22 int i;
23 22
24 for (i = 0; i < dev_dax->num_resources; i++) { 23 addr = pgoff * PAGE_SIZE + res->start;
25 res = &dev_dax->res[i]; 24 if (addr >= res->start && addr <= res->end) {
26 addr = pgoff * PAGE_SIZE + res->start;
27 if (addr >= res->start && addr <= res->end)
28 break;
29 pgoff -= PHYS_PFN(resource_size(res));
30 }
31
32 if (i < dev_dax->num_resources) {
33 res = &dev_dax->res[i];
34 if (addr + size - 1 <= res->end) { 25 if (addr + size - 1 <= res->end) {
35 if (get_nfit_res(addr)) { 26 if (get_nfit_res(addr)) {
36 struct page *page; 27 struct page *page;
@@ -44,6 +35,5 @@ phys_addr_t dax_pgoff_to_phys(struct dev_dax *dev_dax, pgoff_t pgoff,
44 return addr; 35 return addr;
45 } 36 }
46 } 37 }
47
48 return -1; 38 return -1;
49} 39}