lkml.org 
[lkml]   [2016]   [Dec]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 8/8] dax: add debug for region available_size
From
Date
Add dynamic debug statements to dump the per-dax-dev resource
allocations and device offsets.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
drivers/dax/dax.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/dax/dax.c b/drivers/dax/dax.c
index b130eff91b83..d1641e69a088 100644
--- a/drivers/dax/dax.c
+++ b/drivers/dax/dax.c
@@ -97,8 +97,11 @@ static unsigned long long dax_region_avail_size(
WARN_ON_ONCE(!mutex_is_locked(&dax_region->lock));

size = resource_size(&dax_region->res);
- for_each_dax_region_resource(dax_region, res)
+ for_each_dax_region_resource(dax_region, res) {
+ dev_dbg(dax_region->dev, "%s: %pr offset: %lx\n",
+ res->name, res, res->desc);
size -= resource_size(res);
+ }

return size;
}
@@ -372,6 +375,7 @@ struct dax_region *alloc_dax_region(struct device *parent, int region_id,
dax_region->res.name = dev_name(parent);
dax_region->res.start = res->start;
dax_region->res.end = res->end;
+ dax_region->res.flags = IORESOURCE_MEM;
dax_region->pfn_flags = pfn_flags;
mutex_init(&dax_region->lock);
kref_init(&dax_region->kref);
\
 
 \ /
  Last update: 2016-12-11 07:34    [W:0.126 / U:2.748 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site