diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2013-01-08 09:48:15 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2013-02-01 10:13:47 -0500 |
commit | 6a24dfb645dbcb05b34d08b991d082bdaa3ff072 (patch) | |
tree | 4d99948bb2bcb1170778bc668dc4d64e327e8175 | |
parent | 3dc0da278e2b26fa8e353b3a962b2c89e184d353 (diff) |
SUNRPC: Pass pointers to struct rpc_xprt to the congestion window
Avoid access to task->tk_xprt
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r-- | include/linux/sunrpc/xprt.h | 4 | ||||
-rw-r--r-- | net/sunrpc/xprt.c | 6 | ||||
-rw-r--r-- | net/sunrpc/xprtsock.c | 6 |
3 files changed, 8 insertions, 8 deletions
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index 7dd598a5c9aa..30834be03011 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
@@ -122,7 +122,7 @@ struct rpc_xprt_ops { | |||
122 | void (*buf_free)(void *buffer); | 122 | void (*buf_free)(void *buffer); |
123 | int (*send_request)(struct rpc_task *task); | 123 | int (*send_request)(struct rpc_task *task); |
124 | void (*set_retrans_timeout)(struct rpc_task *task); | 124 | void (*set_retrans_timeout)(struct rpc_task *task); |
125 | void (*timer)(struct rpc_task *task); | 125 | void (*timer)(struct rpc_xprt *xprt, struct rpc_task *task); |
126 | void (*release_request)(struct rpc_task *task); | 126 | void (*release_request)(struct rpc_task *task); |
127 | void (*close)(struct rpc_xprt *xprt); | 127 | void (*close)(struct rpc_xprt *xprt); |
128 | void (*destroy)(struct rpc_xprt *xprt); | 128 | void (*destroy)(struct rpc_xprt *xprt); |
@@ -313,7 +313,7 @@ void xprt_set_retrans_timeout_rtt(struct rpc_task *task); | |||
313 | void xprt_wake_pending_tasks(struct rpc_xprt *xprt, int status); | 313 | void xprt_wake_pending_tasks(struct rpc_xprt *xprt, int status); |
314 | void xprt_wait_for_buffer_space(struct rpc_task *task, rpc_action action); | 314 | void xprt_wait_for_buffer_space(struct rpc_task *task, rpc_action action); |
315 | void xprt_write_space(struct rpc_xprt *xprt); | 315 | void xprt_write_space(struct rpc_xprt *xprt); |
316 | void xprt_adjust_cwnd(struct rpc_task *task, int result); | 316 | void xprt_adjust_cwnd(struct rpc_xprt *xprt, struct rpc_task *task, int result); |
317 | struct rpc_rqst * xprt_lookup_rqst(struct rpc_xprt *xprt, __be32 xid); | 317 | struct rpc_rqst * xprt_lookup_rqst(struct rpc_xprt *xprt, __be32 xid); |
318 | void xprt_complete_rqst(struct rpc_task *task, int copied); | 318 | void xprt_complete_rqst(struct rpc_task *task, int copied); |
319 | void xprt_release_rqst_cong(struct rpc_task *task); | 319 | void xprt_release_rqst_cong(struct rpc_task *task); |
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index 774025109e2f..e1e439ea177f 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c | |||
@@ -438,15 +438,15 @@ EXPORT_SYMBOL_GPL(xprt_release_rqst_cong); | |||
438 | 438 | ||
439 | /** | 439 | /** |
440 | * xprt_adjust_cwnd - adjust transport congestion window | 440 | * xprt_adjust_cwnd - adjust transport congestion window |
441 | * @xprt: pointer to xprt | ||
441 | * @task: recently completed RPC request used to adjust window | 442 | * @task: recently completed RPC request used to adjust window |
442 | * @result: result code of completed RPC request | 443 | * @result: result code of completed RPC request |
443 | * | 444 | * |
444 | * We use a time-smoothed congestion estimator to avoid heavy oscillation. | 445 | * We use a time-smoothed congestion estimator to avoid heavy oscillation. |
445 | */ | 446 | */ |
446 | void xprt_adjust_cwnd(struct rpc_task *task, int result) | 447 | void xprt_adjust_cwnd(struct rpc_xprt *xprt, struct rpc_task *task, int result) |
447 | { | 448 | { |
448 | struct rpc_rqst *req = task->tk_rqstp; | 449 | struct rpc_rqst *req = task->tk_rqstp; |
449 | struct rpc_xprt *xprt = task->tk_xprt; | ||
450 | unsigned long cwnd = xprt->cwnd; | 450 | unsigned long cwnd = xprt->cwnd; |
451 | 451 | ||
452 | if (result >= 0 && cwnd <= xprt->cong) { | 452 | if (result >= 0 && cwnd <= xprt->cong) { |
@@ -834,7 +834,7 @@ static void xprt_timer(struct rpc_task *task) | |||
834 | spin_lock_bh(&xprt->transport_lock); | 834 | spin_lock_bh(&xprt->transport_lock); |
835 | if (!req->rq_reply_bytes_recvd) { | 835 | if (!req->rq_reply_bytes_recvd) { |
836 | if (xprt->ops->timer) | 836 | if (xprt->ops->timer) |
837 | xprt->ops->timer(task); | 837 | xprt->ops->timer(xprt, task); |
838 | } else | 838 | } else |
839 | task->tk_status = 0; | 839 | task->tk_status = 0; |
840 | spin_unlock_bh(&xprt->transport_lock); | 840 | spin_unlock_bh(&xprt->transport_lock); |
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index f7d6e4f8c162..37cbda63f45c 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c | |||
@@ -1005,7 +1005,7 @@ static void xs_udp_data_ready(struct sock *sk, int len) | |||
1005 | 1005 | ||
1006 | UDPX_INC_STATS_BH(sk, UDP_MIB_INDATAGRAMS); | 1006 | UDPX_INC_STATS_BH(sk, UDP_MIB_INDATAGRAMS); |
1007 | 1007 | ||
1008 | xprt_adjust_cwnd(task, copied); | 1008 | xprt_adjust_cwnd(xprt, task, copied); |
1009 | xprt_complete_rqst(task, copied); | 1009 | xprt_complete_rqst(task, copied); |
1010 | 1010 | ||
1011 | out_unlock: | 1011 | out_unlock: |
@@ -1646,9 +1646,9 @@ static void xs_udp_set_buffer_size(struct rpc_xprt *xprt, size_t sndsize, size_t | |||
1646 | * | 1646 | * |
1647 | * Adjust the congestion window after a retransmit timeout has occurred. | 1647 | * Adjust the congestion window after a retransmit timeout has occurred. |
1648 | */ | 1648 | */ |
1649 | static void xs_udp_timer(struct rpc_task *task) | 1649 | static void xs_udp_timer(struct rpc_xprt *xprt, struct rpc_task *task) |
1650 | { | 1650 | { |
1651 | xprt_adjust_cwnd(task, -ETIMEDOUT); | 1651 | xprt_adjust_cwnd(xprt, task, -ETIMEDOUT); |
1652 | } | 1652 | } |
1653 | 1653 | ||
1654 | static unsigned short xs_get_random_port(void) | 1654 | static unsigned short xs_get_random_port(void) |