diff options
Diffstat (limited to 'net/sunrpc/stats.c')
-rw-r--r-- | net/sunrpc/stats.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/net/sunrpc/stats.c b/net/sunrpc/stats.c index 1ef6e46d9da2..1b4e6791ecf3 100644 --- a/net/sunrpc/stats.c +++ b/net/sunrpc/stats.c | |||
@@ -141,12 +141,14 @@ EXPORT_SYMBOL_GPL(rpc_free_iostats); | |||
141 | void rpc_count_iostats(struct rpc_task *task) | 141 | void rpc_count_iostats(struct rpc_task *task) |
142 | { | 142 | { |
143 | struct rpc_rqst *req = task->tk_rqstp; | 143 | struct rpc_rqst *req = task->tk_rqstp; |
144 | struct rpc_iostats *stats = task->tk_client->cl_metrics; | 144 | struct rpc_iostats *stats; |
145 | struct rpc_iostats *op_metrics; | 145 | struct rpc_iostats *op_metrics; |
146 | long rtt, execute, queue; | 146 | long rtt, execute, queue; |
147 | 147 | ||
148 | if (!stats || !req) | 148 | if (!task->tk_client || !task->tk_client->cl_metrics || !req) |
149 | return; | 149 | return; |
150 | |||
151 | stats = task->tk_client->cl_metrics; | ||
150 | op_metrics = &stats[task->tk_msg.rpc_proc->p_statidx]; | 152 | op_metrics = &stats[task->tk_msg.rpc_proc->p_statidx]; |
151 | 153 | ||
152 | op_metrics->om_ops++; | 154 | op_metrics->om_ops++; |
@@ -154,7 +156,7 @@ void rpc_count_iostats(struct rpc_task *task) | |||
154 | op_metrics->om_timeouts += task->tk_timeouts; | 156 | op_metrics->om_timeouts += task->tk_timeouts; |
155 | 157 | ||
156 | op_metrics->om_bytes_sent += task->tk_bytes_sent; | 158 | op_metrics->om_bytes_sent += task->tk_bytes_sent; |
157 | op_metrics->om_bytes_recv += req->rq_received; | 159 | op_metrics->om_bytes_recv += req->rq_reply_bytes_recvd; |
158 | 160 | ||
159 | queue = (long)req->rq_xtime - task->tk_start; | 161 | queue = (long)req->rq_xtime - task->tk_start; |
160 | if (queue < 0) | 162 | if (queue < 0) |