From: Trond Myklebust Date: Thu, 17 Apr 2008 16:38:41 -0400 SUNRPC: Clean up struct rpc_task... Move tk_rtt and tk_bytes_sent into struct rpc_rqst, since they are really transport-related variables Signed-off-by: Trond Myklebust --- include/linux/sunrpc/sched.h | 2 -- include/linux/sunrpc/xprt.h | 2 ++ net/sunrpc/stats.c | 4 ++-- net/sunrpc/xprt.c | 2 +- net/sunrpc/xprtsock.c | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index 64981a2..41ec74f 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h @@ -79,9 +79,7 @@ struct rpc_task { } u; unsigned short tk_timeouts; /* maj timeouts */ - size_t tk_bytes_sent; /* total bytes sent */ unsigned long tk_start; /* RPC task init timestamp */ - long tk_rtt; /* round-trip time (jiffies) */ pid_t tk_owner; /* Process id for batching tasks */ unsigned char tk_priority : 2;/* Task priority */ diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index 4d80a11..2eacfb3 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h @@ -95,8 +95,10 @@ struct rpc_rqst { * Partial send handling */ u32 rq_bytes_sent; /* Bytes we have sent */ + size_t rq_total_bytes_sent; unsigned long rq_xtime; /* when transmitted */ + long rq_rtt; /* round-trip time (jiffies) */ int rq_ntrans; }; #define rq_svec rq_snd_buf.head diff --git a/net/sunrpc/stats.c b/net/sunrpc/stats.c index 50b049c..b118de7 100644 --- a/net/sunrpc/stats.c +++ b/net/sunrpc/stats.c @@ -153,7 +153,7 @@ void rpc_count_iostats(struct rpc_task *task) op_metrics->om_ntrans += req->rq_ntrans; op_metrics->om_timeouts += task->tk_timeouts; - op_metrics->om_bytes_sent += task->tk_bytes_sent; + op_metrics->om_bytes_sent += req->rq_total_bytes_sent; op_metrics->om_bytes_recv += req->rq_received; queue = (long)req->rq_xtime - task->tk_start; @@ -161,7 +161,7 @@ void rpc_count_iostats(struct rpc_task *task) queue = -queue; op_metrics->om_queue += queue; - rtt = task->tk_rtt; + rtt = req->rq_rtt; if (rtt < 0) rtt = -rtt; op_metrics->om_rtt += rtt; diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index 99a52aa..762ca17 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c @@ -775,7 +775,7 @@ void xprt_complete_rqst(struct rpc_task *task, int copied) task->tk_pid, ntohl(req->rq_xid), copied); xprt->stat.recvs++; - task->tk_rtt = (long)jiffies - req->rq_xtime; + req->rq_rtt = (long)jiffies - req->rq_xtime; list_del_init(&req->rq_list); req->rq_private_buf.len = copied; diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index 4486c59..dd7ad80 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c @@ -588,7 +588,7 @@ static int xs_udp_send_request(struct rpc_task *task) xdr->len - req->rq_bytes_sent, status); if (status >= 0) { - task->tk_bytes_sent += status; + req->rq_total_bytes_sent += status; if (status >= req->rq_slen) return 0; /* Still some bytes left; set up for a retry later. */ @@ -682,7 +682,7 @@ static int xs_tcp_send_request(struct rpc_task *task) /* If we've sent the entire packet, immediately * reset the count of bytes sent. */ req->rq_bytes_sent += status; - task->tk_bytes_sent += status; + req->rq_total_bytes_sent += status; if (likely(req->rq_bytes_sent >= req->rq_slen)) { req->rq_bytes_sent = 0; return 0;