summaryrefslogtreecommitdiff
path: root/net/sunrpc/xprt.c
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2010-12-08 13:48:19 -0500
committerJ. Bruce Fields <bfields@redhat.com>2011-01-11 15:04:10 -0500
commitf0418aa4b1103f959d64dc18273efa04ee0140e9 (patch)
tree01457cfe70d614dcdb12759247212602c2c2c008 /net/sunrpc/xprt.c
parent99de8ea962bbc11a51ad4c52e3dc93bee5f6ba70 (diff)
downloadlinux-3.10-f0418aa4b1103f959d64dc18273efa04ee0140e9.tar.gz
linux-3.10-f0418aa4b1103f959d64dc18273efa04ee0140e9.tar.bz2
linux-3.10-f0418aa4b1103f959d64dc18273efa04ee0140e9.zip
rpc: allow xprt_class->setup to return a preexisting xprt
This allows us to reuse the xprt associated with a server connection if one has already been set up. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'net/sunrpc/xprt.c')
-rw-r--r--net/sunrpc/xprt.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index 749ad15ae30..856274d7e85 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -1102,6 +1102,9 @@ found:
-PTR_ERR(xprt));
return xprt;
}
+ if (test_and_set_bit(XPRT_INITIALIZED, &xprt->state))
+ /* ->setup returned a pre-initialized xprt: */
+ return xprt;
spin_lock_init(&xprt->transport_lock);
spin_lock_init(&xprt->reserve_lock);