diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2013-01-08 09:26:49 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2013-02-01 10:13:47 -0500 |
commit | 1b092092bf0e2e8b7af1c2a03f615b4e60b05d47 (patch) | |
tree | 4efc332b4648144fa055fa72f1867cbc2b30e756 /net/sunrpc | |
parent | a4f0835c604f80f945ab3e72ffd00547145c4b2b (diff) |
SUNRPC: Pass a pointer to struct rpc_xprt to the connect callback
Avoid another RCU dereference by passing the pointer to struct rpc_xprt
from the caller.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r-- | net/sunrpc/xprt.c | 2 | ||||
-rw-r--r-- | net/sunrpc/xprtrdma/transport.c | 3 | ||||
-rw-r--r-- | net/sunrpc/xprtsock.c | 4 |
3 files changed, 4 insertions, 5 deletions
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index 738ad59628cd..774025109e2f 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c | |||
@@ -724,7 +724,7 @@ void xprt_connect(struct rpc_task *task) | |||
724 | if (xprt_test_and_set_connecting(xprt)) | 724 | if (xprt_test_and_set_connecting(xprt)) |
725 | return; | 725 | return; |
726 | xprt->stat.connect_start = jiffies; | 726 | xprt->stat.connect_start = jiffies; |
727 | xprt->ops->connect(task); | 727 | xprt->ops->connect(xprt, task); |
728 | } | 728 | } |
729 | } | 729 | } |
730 | 730 | ||
diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c index b357c528d29c..d0074289708e 100644 --- a/net/sunrpc/xprtrdma/transport.c +++ b/net/sunrpc/xprtrdma/transport.c | |||
@@ -426,9 +426,8 @@ xprt_rdma_set_port(struct rpc_xprt *xprt, u16 port) | |||
426 | } | 426 | } |
427 | 427 | ||
428 | static void | 428 | static void |
429 | xprt_rdma_connect(struct rpc_task *task) | 429 | xprt_rdma_connect(struct rpc_xprt *xprt, struct rpc_task *task) |
430 | { | 430 | { |
431 | struct rpc_xprt *xprt = (struct rpc_xprt *)task->tk_xprt; | ||
432 | struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(xprt); | 431 | struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(xprt); |
433 | 432 | ||
434 | if (r_xprt->rx_ep.rep_connected != 0) { | 433 | if (r_xprt->rx_ep.rep_connected != 0) { |
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index 25838901c97f..1897181d7438 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c | |||
@@ -2205,6 +2205,7 @@ out: | |||
2205 | 2205 | ||
2206 | /** | 2206 | /** |
2207 | * xs_connect - connect a socket to a remote endpoint | 2207 | * xs_connect - connect a socket to a remote endpoint |
2208 | * @xprt: pointer to transport structure | ||
2208 | * @task: address of RPC task that manages state of connect request | 2209 | * @task: address of RPC task that manages state of connect request |
2209 | * | 2210 | * |
2210 | * TCP: If the remote end dropped the connection, delay reconnecting. | 2211 | * TCP: If the remote end dropped the connection, delay reconnecting. |
@@ -2216,9 +2217,8 @@ out: | |||
2216 | * If a UDP socket connect fails, the delay behavior here prevents | 2217 | * If a UDP socket connect fails, the delay behavior here prevents |
2217 | * retry floods (hard mounts). | 2218 | * retry floods (hard mounts). |
2218 | */ | 2219 | */ |
2219 | static void xs_connect(struct rpc_task *task) | 2220 | static void xs_connect(struct rpc_xprt *xprt, struct rpc_task *task) |
2220 | { | 2221 | { |
2221 | struct rpc_xprt *xprt = task->tk_xprt; | ||
2222 | struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt); | 2222 | struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt); |
2223 | 2223 | ||
2224 | if (transport->sock != NULL && !RPC_IS_SOFTCONN(task)) { | 2224 | if (transport->sock != NULL && !RPC_IS_SOFTCONN(task)) { |