diff options
author | Weston Andros Adamson <dros@primarydata.com> | 2014-06-24 10:59:52 -0400 |
---|---|---|
committer | Tom Haynes <loghyr@primarydata.com> | 2015-02-03 14:06:38 -0500 |
commit | 840210fc4872bcbc17ab4f435f28021dce9d0aff (patch) | |
tree | 6be82bb7ca5a4ef88746e023b139e2dda7b7e566 /net/sunrpc | |
parent | 16cecdf620eb23d2654a265d9b20e089370d7425 (diff) |
sunrpc: add rpc_count_iostats_idx
Add a call to tally stats for a task under a different statsidx than
what's contained in the task structure.
This is needed to properly account for pnfs reads/writes when the
DS nfs version != the MDS version.
Signed-off-by: Weston Andros Adamson <dros@primarydata.com>
Signed-off-by: Tom Haynes <Thomas.Haynes@primarydata.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r-- | net/sunrpc/stats.c | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/net/sunrpc/stats.c b/net/sunrpc/stats.c index 9711a155bc50..2ecb994314c1 100644 --- a/net/sunrpc/stats.c +++ b/net/sunrpc/stats.c | |||
@@ -140,22 +140,20 @@ void rpc_free_iostats(struct rpc_iostats *stats) | |||
140 | EXPORT_SYMBOL_GPL(rpc_free_iostats); | 140 | EXPORT_SYMBOL_GPL(rpc_free_iostats); |
141 | 141 | ||
142 | /** | 142 | /** |
143 | * rpc_count_iostats - tally up per-task stats | 143 | * rpc_count_iostats_metrics - tally up per-task stats |
144 | * @task: completed rpc_task | 144 | * @task: completed rpc_task |
145 | * @stats: array of stat structures | 145 | * @op_metrics: stat structure for OP that will accumulate stats from @task |
146 | */ | 146 | */ |
147 | void rpc_count_iostats(const struct rpc_task *task, struct rpc_iostats *stats) | 147 | void rpc_count_iostats_metrics(const struct rpc_task *task, |
148 | struct rpc_iostats *op_metrics) | ||
148 | { | 149 | { |
149 | struct rpc_rqst *req = task->tk_rqstp; | 150 | struct rpc_rqst *req = task->tk_rqstp; |
150 | struct rpc_iostats *op_metrics; | ||
151 | ktime_t delta, now; | 151 | ktime_t delta, now; |
152 | 152 | ||
153 | if (!stats || !req) | 153 | if (!op_metrics || !req) |
154 | return; | 154 | return; |
155 | 155 | ||
156 | now = ktime_get(); | 156 | now = ktime_get(); |
157 | op_metrics = &stats[task->tk_msg.rpc_proc->p_statidx]; | ||
158 | |||
159 | spin_lock(&op_metrics->om_lock); | 157 | spin_lock(&op_metrics->om_lock); |
160 | 158 | ||
161 | op_metrics->om_ops++; | 159 | op_metrics->om_ops++; |
@@ -175,6 +173,20 @@ void rpc_count_iostats(const struct rpc_task *task, struct rpc_iostats *stats) | |||
175 | 173 | ||
176 | spin_unlock(&op_metrics->om_lock); | 174 | spin_unlock(&op_metrics->om_lock); |
177 | } | 175 | } |
176 | EXPORT_SYMBOL_GPL(rpc_count_iostats_metrics); | ||
177 | |||
178 | /** | ||
179 | * rpc_count_iostats - tally up per-task stats | ||
180 | * @task: completed rpc_task | ||
181 | * @stats: array of stat structures | ||
182 | * | ||
183 | * Uses the statidx from @task | ||
184 | */ | ||
185 | void rpc_count_iostats(const struct rpc_task *task, struct rpc_iostats *stats) | ||
186 | { | ||
187 | rpc_count_iostats_metrics(task, | ||
188 | &stats[task->tk_msg.rpc_proc->p_statidx]); | ||
189 | } | ||
178 | EXPORT_SYMBOL_GPL(rpc_count_iostats); | 190 | EXPORT_SYMBOL_GPL(rpc_count_iostats); |
179 | 191 | ||
180 | static void _print_name(struct seq_file *seq, unsigned int op, | 192 | static void _print_name(struct seq_file *seq, unsigned int op, |