clnt.c (f895b252d4edf66b2895fb5a7b17a638665f3e1f) | clnt.c (b4b9d2ccf0be61c69213f6ae4e33377c05194ef4) |
---|---|
1/* 2 * linux/net/sunrpc/clnt.c 3 * 4 * This file contains the high-level RPC interface. 5 * It is modeled as a finite state machine to support both synchronous 6 * and asynchronous requests. 7 * 8 * - RPC header generation and argument serialization. --- 291 unchanged lines hidden (view full) --- 300 .pseudoflavor = pseudoflavor, 301 .target_name = client_name, 302 }; 303 struct rpc_auth *auth; 304 struct net *net = rpc_net_ns(clnt); 305 struct super_block *pipefs_sb; 306 int err; 307 | 1/* 2 * linux/net/sunrpc/clnt.c 3 * 4 * This file contains the high-level RPC interface. 5 * It is modeled as a finite state machine to support both synchronous 6 * and asynchronous requests. 7 * 8 * - RPC header generation and argument serialization. --- 291 unchanged lines hidden (view full) --- 300 .pseudoflavor = pseudoflavor, 301 .target_name = client_name, 302 }; 303 struct rpc_auth *auth; 304 struct net *net = rpc_net_ns(clnt); 305 struct super_block *pipefs_sb; 306 int err; 307 |
308 err = rpc_clnt_debugfs_register(clnt); 309 if (err) 310 return err; 311 |
|
308 pipefs_sb = rpc_get_sb_net(net); 309 if (pipefs_sb) { 310 err = rpc_setup_pipedir(pipefs_sb, clnt); 311 if (err) 312 goto out; 313 } 314 315 rpc_register_client(clnt); --- 10 unchanged lines hidden (view full) --- 326 return 0; 327err_auth: 328 pipefs_sb = rpc_get_sb_net(net); 329 rpc_unregister_client(clnt); 330 __rpc_clnt_remove_pipedir(clnt); 331out: 332 if (pipefs_sb) 333 rpc_put_sb_net(net); | 312 pipefs_sb = rpc_get_sb_net(net); 313 if (pipefs_sb) { 314 err = rpc_setup_pipedir(pipefs_sb, clnt); 315 if (err) 316 goto out; 317 } 318 319 rpc_register_client(clnt); --- 10 unchanged lines hidden (view full) --- 330 return 0; 331err_auth: 332 pipefs_sb = rpc_get_sb_net(net); 333 rpc_unregister_client(clnt); 334 __rpc_clnt_remove_pipedir(clnt); 335out: 336 if (pipefs_sb) 337 rpc_put_sb_net(net); |
338 rpc_clnt_debugfs_unregister(clnt); |
|
334 return err; 335} 336 337static DEFINE_IDA(rpc_clids); 338 339static int rpc_alloc_clid(struct rpc_clnt *clnt) 340{ 341 int clid; --- 323 unchanged lines hidden (view full) --- 665 666 pseudoflavor = clnt->cl_auth->au_flavor; 667 668 old_timeo = clnt->cl_timeout; 669 old = rpc_clnt_set_transport(clnt, xprt, timeout); 670 671 rpc_unregister_client(clnt); 672 __rpc_clnt_remove_pipedir(clnt); | 339 return err; 340} 341 342static DEFINE_IDA(rpc_clids); 343 344static int rpc_alloc_clid(struct rpc_clnt *clnt) 345{ 346 int clid; --- 323 unchanged lines hidden (view full) --- 670 671 pseudoflavor = clnt->cl_auth->au_flavor; 672 673 old_timeo = clnt->cl_timeout; 674 old = rpc_clnt_set_transport(clnt, xprt, timeout); 675 676 rpc_unregister_client(clnt); 677 __rpc_clnt_remove_pipedir(clnt); |
678 rpc_clnt_debugfs_unregister(clnt); |
|
673 674 /* 675 * A new transport was created. "clnt" therefore 676 * becomes the root of a new cl_parent tree. clnt's 677 * children, if it has any, still point to the old xprt. 678 */ 679 parent = clnt->cl_parent; 680 clnt->cl_parent = clnt; --- 85 unchanged lines hidden (view full) --- 766{ 767 struct rpc_clnt *parent = NULL; 768 769 dprintk_rcu("RPC: destroying %s client for %s\n", 770 clnt->cl_program->name, 771 rcu_dereference(clnt->cl_xprt)->servername); 772 if (clnt->cl_parent != clnt) 773 parent = clnt->cl_parent; | 679 680 /* 681 * A new transport was created. "clnt" therefore 682 * becomes the root of a new cl_parent tree. clnt's 683 * children, if it has any, still point to the old xprt. 684 */ 685 parent = clnt->cl_parent; 686 clnt->cl_parent = clnt; --- 85 unchanged lines hidden (view full) --- 772{ 773 struct rpc_clnt *parent = NULL; 774 775 dprintk_rcu("RPC: destroying %s client for %s\n", 776 clnt->cl_program->name, 777 rcu_dereference(clnt->cl_xprt)->servername); 778 if (clnt->cl_parent != clnt) 779 parent = clnt->cl_parent; |
780 rpc_clnt_debugfs_unregister(clnt); |
|
774 rpc_clnt_remove_pipedir(clnt); 775 rpc_unregister_client(clnt); 776 rpc_free_iostats(clnt->cl_metrics); 777 clnt->cl_metrics = NULL; 778 xprt_put(rcu_dereference_raw(clnt->cl_xprt)); 779 rpciod_down(); 780 rpc_free_clid(clnt); 781 kfree(clnt); --- 610 unchanged lines hidden (view full) --- 1392 return 0; 1393 task->tk_action = call_start; 1394 task->tk_status = 0; 1395 return 1; 1396} 1397EXPORT_SYMBOL_GPL(rpc_restart_call); 1398 1399#if IS_ENABLED(CONFIG_SUNRPC_DEBUG) | 781 rpc_clnt_remove_pipedir(clnt); 782 rpc_unregister_client(clnt); 783 rpc_free_iostats(clnt->cl_metrics); 784 clnt->cl_metrics = NULL; 785 xprt_put(rcu_dereference_raw(clnt->cl_xprt)); 786 rpciod_down(); 787 rpc_free_clid(clnt); 788 kfree(clnt); --- 610 unchanged lines hidden (view full) --- 1399 return 0; 1400 task->tk_action = call_start; 1401 task->tk_status = 0; 1402 return 1; 1403} 1404EXPORT_SYMBOL_GPL(rpc_restart_call); 1405 1406#if IS_ENABLED(CONFIG_SUNRPC_DEBUG) |
1400static const char *rpc_proc_name(const struct rpc_task *task) | 1407const char 1408*rpc_proc_name(const struct rpc_task *task) |
1401{ 1402 const struct rpc_procinfo *proc = task->tk_msg.rpc_proc; 1403 1404 if (proc) { 1405 if (proc->p_name) 1406 return proc->p_name; 1407 else 1408 return "NULL"; --- 1059 unchanged lines hidden --- | 1409{ 1410 const struct rpc_procinfo *proc = task->tk_msg.rpc_proc; 1411 1412 if (proc) { 1413 if (proc->p_name) 1414 return proc->p_name; 1415 else 1416 return "NULL"; --- 1059 unchanged lines hidden --- |