diff options
-rw-r--r-- | include/linux/sunrpc/clnt.h | 2 | ||||
-rw-r--r-- | net/sunrpc/rpcb_clnt.c | 37 | ||||
-rw-r--r-- | net/sunrpc/xprtsock.c | 4 |
3 files changed, 22 insertions, 21 deletions
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index b28d919c7758..c1b37972b0d5 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h | |||
@@ -122,8 +122,8 @@ void rpc_shutdown_client(struct rpc_clnt *); | |||
122 | void rpc_release_client(struct rpc_clnt *); | 122 | void rpc_release_client(struct rpc_clnt *); |
123 | 123 | ||
124 | int rpcb_register(u32, u32, int, unsigned short, int *); | 124 | int rpcb_register(u32, u32, int, unsigned short, int *); |
125 | void rpcb_getport(struct rpc_task *); | ||
126 | int rpcb_getport_sync(struct sockaddr_in *, __u32, __u32, int); | 125 | int rpcb_getport_sync(struct sockaddr_in *, __u32, __u32, int); |
126 | void rpcb_getport_async(struct rpc_task *); | ||
127 | 127 | ||
128 | void rpc_call_setup(struct rpc_task *, struct rpc_message *, int); | 128 | void rpc_call_setup(struct rpc_task *, struct rpc_message *, int); |
129 | 129 | ||
diff --git a/net/sunrpc/rpcb_clnt.c b/net/sunrpc/rpcb_clnt.c index fc881a675eb9..d1740dbab991 100644 --- a/net/sunrpc/rpcb_clnt.c +++ b/net/sunrpc/rpcb_clnt.c | |||
@@ -300,13 +300,13 @@ int rpcb_getport_sync(struct sockaddr_in *sin, __u32 prog, | |||
300 | EXPORT_SYMBOL_GPL(rpcb_getport_sync); | 300 | EXPORT_SYMBOL_GPL(rpcb_getport_sync); |
301 | 301 | ||
302 | /** | 302 | /** |
303 | * rpcb_getport - obtain the port for a given RPC service on a given host | 303 | * rpcb_getport_async - obtain the port for a given RPC service on a given host |
304 | * @task: task that is waiting for portmapper request | 304 | * @task: task that is waiting for portmapper request |
305 | * | 305 | * |
306 | * This one can be called for an ongoing RPC request, and can be used in | 306 | * This one can be called for an ongoing RPC request, and can be used in |
307 | * an async (rpciod) context. | 307 | * an async (rpciod) context. |
308 | */ | 308 | */ |
309 | void rpcb_getport(struct rpc_task *task) | 309 | void rpcb_getport_async(struct rpc_task *task) |
310 | { | 310 | { |
311 | struct rpc_clnt *clnt = task->tk_client; | 311 | struct rpc_clnt *clnt = task->tk_client; |
312 | int bind_version; | 312 | int bind_version; |
@@ -317,17 +317,17 @@ void rpcb_getport(struct rpc_task *task) | |||
317 | struct sockaddr addr; | 317 | struct sockaddr addr; |
318 | int status; | 318 | int status; |
319 | 319 | ||
320 | dprintk("RPC: %5u rpcb_getport(%s, %u, %u, %d)\n", | 320 | dprintk("RPC: %5u %s(%s, %u, %u, %d)\n", |
321 | task->tk_pid, clnt->cl_server, | 321 | task->tk_pid, __FUNCTION__, |
322 | clnt->cl_prog, clnt->cl_vers, xprt->prot); | 322 | clnt->cl_server, clnt->cl_prog, clnt->cl_vers, xprt->prot); |
323 | 323 | ||
324 | /* Autobind on cloned rpc clients is discouraged */ | 324 | /* Autobind on cloned rpc clients is discouraged */ |
325 | BUG_ON(clnt->cl_parent != clnt); | 325 | BUG_ON(clnt->cl_parent != clnt); |
326 | 326 | ||
327 | if (xprt_test_and_set_binding(xprt)) { | 327 | if (xprt_test_and_set_binding(xprt)) { |
328 | status = -EACCES; /* tell caller to check again */ | 328 | status = -EACCES; /* tell caller to check again */ |
329 | dprintk("RPC: %5u rpcb_getport waiting for another binder\n", | 329 | dprintk("RPC: %5u %s: waiting for another binder\n", |
330 | task->tk_pid); | 330 | task->tk_pid, __FUNCTION__); |
331 | goto bailout_nowake; | 331 | goto bailout_nowake; |
332 | } | 332 | } |
333 | 333 | ||
@@ -338,27 +338,28 @@ void rpcb_getport(struct rpc_task *task) | |||
338 | /* Someone else may have bound if we slept */ | 338 | /* Someone else may have bound if we slept */ |
339 | if (xprt_bound(xprt)) { | 339 | if (xprt_bound(xprt)) { |
340 | status = 0; | 340 | status = 0; |
341 | dprintk("RPC: %5u rpcb_getport already bound\n", task->tk_pid); | 341 | dprintk("RPC: %5u %s: already bound\n", |
342 | task->tk_pid, __FUNCTION__); | ||
342 | goto bailout_nofree; | 343 | goto bailout_nofree; |
343 | } | 344 | } |
344 | 345 | ||
345 | if (rpcb_next_version[xprt->bind_index].rpc_proc == NULL) { | 346 | if (rpcb_next_version[xprt->bind_index].rpc_proc == NULL) { |
346 | xprt->bind_index = 0; | 347 | xprt->bind_index = 0; |
347 | status = -EACCES; /* tell caller to try again later */ | 348 | status = -EACCES; /* tell caller to try again later */ |
348 | dprintk("RPC: %5u rpcb_getport no more getport versions " | 349 | dprintk("RPC: %5u %s: no more getport versions available\n", |
349 | "available\n", task->tk_pid); | 350 | task->tk_pid, __FUNCTION__); |
350 | goto bailout_nofree; | 351 | goto bailout_nofree; |
351 | } | 352 | } |
352 | bind_version = rpcb_next_version[xprt->bind_index].rpc_vers; | 353 | bind_version = rpcb_next_version[xprt->bind_index].rpc_vers; |
353 | 354 | ||
354 | dprintk("RPC: %5u rpcb_getport trying rpcbind version %u\n", | 355 | dprintk("RPC: %5u %s: trying rpcbind version %u\n", |
355 | task->tk_pid, bind_version); | 356 | task->tk_pid, __FUNCTION__, bind_version); |
356 | 357 | ||
357 | map = kzalloc(sizeof(struct rpcbind_args), GFP_ATOMIC); | 358 | map = kzalloc(sizeof(struct rpcbind_args), GFP_ATOMIC); |
358 | if (!map) { | 359 | if (!map) { |
359 | status = -ENOMEM; | 360 | status = -ENOMEM; |
360 | dprintk("RPC: %5u rpcb_getport no memory available\n", | 361 | dprintk("RPC: %5u %s: no memory available\n", |
361 | task->tk_pid); | 362 | task->tk_pid, __FUNCTION__); |
362 | goto bailout_nofree; | 363 | goto bailout_nofree; |
363 | } | 364 | } |
364 | map->r_prog = clnt->cl_prog; | 365 | map->r_prog = clnt->cl_prog; |
@@ -376,8 +377,8 @@ void rpcb_getport(struct rpc_task *task) | |||
376 | rpcb_clnt = rpcb_create(clnt->cl_server, &addr, xprt->prot, bind_version, 0); | 377 | rpcb_clnt = rpcb_create(clnt->cl_server, &addr, xprt->prot, bind_version, 0); |
377 | if (IS_ERR(rpcb_clnt)) { | 378 | if (IS_ERR(rpcb_clnt)) { |
378 | status = PTR_ERR(rpcb_clnt); | 379 | status = PTR_ERR(rpcb_clnt); |
379 | dprintk("RPC: %5u rpcb_getport rpcb_create failed, error %ld\n", | 380 | dprintk("RPC: %5u %s: rpcb_create failed, error %ld\n", |
380 | task->tk_pid, PTR_ERR(rpcb_clnt)); | 381 | task->tk_pid, __FUNCTION__, PTR_ERR(rpcb_clnt)); |
381 | goto bailout; | 382 | goto bailout; |
382 | } | 383 | } |
383 | 384 | ||
@@ -385,8 +386,8 @@ void rpcb_getport(struct rpc_task *task) | |||
385 | rpc_release_client(rpcb_clnt); | 386 | rpc_release_client(rpcb_clnt); |
386 | if (IS_ERR(child)) { | 387 | if (IS_ERR(child)) { |
387 | status = -EIO; | 388 | status = -EIO; |
388 | dprintk("RPC: %5u rpcb_getport rpc_run_task failed\n", | 389 | dprintk("RPC: %5u %s: rpc_run_task failed\n", |
389 | task->tk_pid); | 390 | task->tk_pid, __FUNCTION__); |
390 | goto bailout_nofree; | 391 | goto bailout_nofree; |
391 | } | 392 | } |
392 | rpc_put_task(child); | 393 | rpc_put_task(child); |
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index ee6ad3baf680..a8f7c5fd752c 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c | |||
@@ -1473,7 +1473,7 @@ static struct rpc_xprt_ops xs_udp_ops = { | |||
1473 | .set_buffer_size = xs_udp_set_buffer_size, | 1473 | .set_buffer_size = xs_udp_set_buffer_size, |
1474 | .reserve_xprt = xprt_reserve_xprt_cong, | 1474 | .reserve_xprt = xprt_reserve_xprt_cong, |
1475 | .release_xprt = xprt_release_xprt_cong, | 1475 | .release_xprt = xprt_release_xprt_cong, |
1476 | .rpcbind = rpcb_getport, | 1476 | .rpcbind = rpcb_getport_async, |
1477 | .set_port = xs_set_port, | 1477 | .set_port = xs_set_port, |
1478 | .connect = xs_connect, | 1478 | .connect = xs_connect, |
1479 | .buf_alloc = rpc_malloc, | 1479 | .buf_alloc = rpc_malloc, |
@@ -1490,7 +1490,7 @@ static struct rpc_xprt_ops xs_udp_ops = { | |||
1490 | static struct rpc_xprt_ops xs_tcp_ops = { | 1490 | static struct rpc_xprt_ops xs_tcp_ops = { |
1491 | .reserve_xprt = xprt_reserve_xprt, | 1491 | .reserve_xprt = xprt_reserve_xprt, |
1492 | .release_xprt = xs_tcp_release_xprt, | 1492 | .release_xprt = xs_tcp_release_xprt, |
1493 | .rpcbind = rpcb_getport, | 1493 | .rpcbind = rpcb_getport_async, |
1494 | .set_port = xs_set_port, | 1494 | .set_port = xs_set_port, |
1495 | .connect = xs_connect, | 1495 | .connect = xs_connect, |
1496 | .buf_alloc = rpc_malloc, | 1496 | .buf_alloc = rpc_malloc, |