summaryrefslogtreecommitdiffstats
path: root/net/sunrpc/xprtsock.c
diff options
context:
space:
mode:
authorTrond Myklebust2013-01-08 15:26:49 +0100
committerTrond Myklebust2013-02-01 16:13:47 +0100
commit1b092092bf0e2e8b7af1c2a03f615b4e60b05d47 (patch)
tree4efc332b4648144fa055fa72f1867cbc2b30e756 /net/sunrpc/xprtsock.c
parentSUNRPC: Eliminate task->tk_xprt accesses that bypass rcu_dereference() (diff)
downloadkernel-qcow2-linux-1b092092bf0e2e8b7af1c2a03f615b4e60b05d47.tar.gz
kernel-qcow2-linux-1b092092bf0e2e8b7af1c2a03f615b4e60b05d47.tar.xz
kernel-qcow2-linux-1b092092bf0e2e8b7af1c2a03f615b4e60b05d47.zip
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/xprtsock.c')
-rw-r--r--net/sunrpc/xprtsock.c4
1 files changed, 2 insertions, 2 deletions
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:
/**
* xs_connect - connect a socket to a remote endpoint
+ * @xprt: pointer to transport structure
* @task: address of RPC task that manages state of connect request
*
* TCP: If the remote end dropped the connection, delay reconnecting.
@@ -2216,9 +2217,8 @@ out:
* If a UDP socket connect fails, the delay behavior here prevents
* retry floods (hard mounts).
*/
-static void xs_connect(struct rpc_task *task)
+static void xs_connect(struct rpc_xprt *xprt, struct rpc_task *task)
{
- struct rpc_xprt *xprt = task->tk_xprt;
struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt);
if (transport->sock != NULL && !RPC_IS_SOFTCONN(task)) {