diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-03-01 17:01:05 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-03-02 15:36:41 -0500 |
commit | 4e0038b6b246e4145fc4a53dca61a556d17bc52c (patch) | |
tree | 67055f0c5dca7a4a24b062b1320675ad468d7b69 /net/sunrpc/xprt.c | |
parent | 2446ab6070861aba2dd9229463ffbc40016a9f33 (diff) |
SUNRPC: Move clnt->cl_server into struct rpc_xprt
When the cl_xprt field is updated, the cl_server field will also have
to change. Since the contents of cl_server follow the remote endpoint
of cl_xprt, just move that field to the rpc_xprt.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
[ cel: simplify check_gss_callback_principal(), whitespace changes ]
[ cel: forward ported to 3.4 ]
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/xprt.c')
-rw-r--r-- | net/sunrpc/xprt.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index 32e37945a840..0cbcd1ab49ab 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c | |||
@@ -66,6 +66,7 @@ static void xprt_init(struct rpc_xprt *xprt, struct net *net); | |||
66 | static void xprt_request_init(struct rpc_task *, struct rpc_xprt *); | 66 | static void xprt_request_init(struct rpc_task *, struct rpc_xprt *); |
67 | static void xprt_connect_status(struct rpc_task *task); | 67 | static void xprt_connect_status(struct rpc_task *task); |
68 | static int __xprt_get_cong(struct rpc_xprt *, struct rpc_task *); | 68 | static int __xprt_get_cong(struct rpc_xprt *, struct rpc_task *); |
69 | static void xprt_destroy(struct rpc_xprt *xprt); | ||
69 | 70 | ||
70 | static DEFINE_SPINLOCK(xprt_list_lock); | 71 | static DEFINE_SPINLOCK(xprt_list_lock); |
71 | static LIST_HEAD(xprt_list); | 72 | static LIST_HEAD(xprt_list); |
@@ -751,7 +752,7 @@ static void xprt_connect_status(struct rpc_task *task) | |||
751 | default: | 752 | default: |
752 | dprintk("RPC: %5u xprt_connect_status: error %d connecting to " | 753 | dprintk("RPC: %5u xprt_connect_status: error %d connecting to " |
753 | "server %s\n", task->tk_pid, -task->tk_status, | 754 | "server %s\n", task->tk_pid, -task->tk_status, |
754 | task->tk_client->cl_server); | 755 | xprt->servername); |
755 | xprt_release_write(xprt, task); | 756 | xprt_release_write(xprt, task); |
756 | task->tk_status = -EIO; | 757 | task->tk_status = -EIO; |
757 | } | 758 | } |
@@ -1229,6 +1230,17 @@ found: | |||
1229 | (unsigned long)xprt); | 1230 | (unsigned long)xprt); |
1230 | else | 1231 | else |
1231 | init_timer(&xprt->timer); | 1232 | init_timer(&xprt->timer); |
1233 | |||
1234 | if (strlen(args->servername) > RPC_MAXNETNAMELEN) { | ||
1235 | xprt_destroy(xprt); | ||
1236 | return ERR_PTR(-EINVAL); | ||
1237 | } | ||
1238 | xprt->servername = kstrdup(args->servername, GFP_KERNEL); | ||
1239 | if (xprt->servername == NULL) { | ||
1240 | xprt_destroy(xprt); | ||
1241 | return ERR_PTR(-ENOMEM); | ||
1242 | } | ||
1243 | |||
1232 | dprintk("RPC: created transport %p with %u slots\n", xprt, | 1244 | dprintk("RPC: created transport %p with %u slots\n", xprt, |
1233 | xprt->max_reqs); | 1245 | xprt->max_reqs); |
1234 | out: | 1246 | out: |
@@ -1251,6 +1263,7 @@ static void xprt_destroy(struct rpc_xprt *xprt) | |||
1251 | rpc_destroy_wait_queue(&xprt->sending); | 1263 | rpc_destroy_wait_queue(&xprt->sending); |
1252 | rpc_destroy_wait_queue(&xprt->backlog); | 1264 | rpc_destroy_wait_queue(&xprt->backlog); |
1253 | cancel_work_sync(&xprt->task_cleanup); | 1265 | cancel_work_sync(&xprt->task_cleanup); |
1266 | kfree(xprt->servername); | ||
1254 | /* | 1267 | /* |
1255 | * Tear down transport state and free the rpc_xprt | 1268 | * Tear down transport state and free the rpc_xprt |
1256 | */ | 1269 | */ |