diff options
author | J. Bruce Fields <bfields@redhat.com> | 2010-12-08 13:48:19 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2011-01-11 15:04:10 -0500 |
commit | f0418aa4b1103f959d64dc18273efa04ee0140e9 (patch) | |
tree | 01457cfe70d614dcdb12759247212602c2c2c008 /net/sunrpc/xprt.c | |
parent | 99de8ea962bbc11a51ad4c52e3dc93bee5f6ba70 (diff) |
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.c | 3 |
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); |