diff options
Diffstat (limited to 'net/sunrpc/rpcb_clnt.c')
-rw-r--r-- | net/sunrpc/rpcb_clnt.c | 37 |
1 files changed, 19 insertions, 18 deletions
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); |