Lines Matching refs:clnt

3  *  linux/net/sunrpc/clnt.c
36 #include <linux/sunrpc/clnt.h>
78 static int rpc_ping(struct rpc_clnt *clnt);
79 static int rpc_ping_noreply(struct rpc_clnt *clnt);
82 static void rpc_register_client(struct rpc_clnt *clnt)
84 struct net *net = rpc_net_ns(clnt);
88 list_add(&clnt->cl_clients, &sn->all_clients);
92 static void rpc_unregister_client(struct rpc_clnt *clnt)
94 struct net *net = rpc_net_ns(clnt);
98 list_del(&clnt->cl_clients);
102 static void __rpc_clnt_remove_pipedir(struct rpc_clnt *clnt)
104 rpc_remove_client_dir(clnt);
107 static void rpc_clnt_remove_pipedir(struct rpc_clnt *clnt)
109 struct net *net = rpc_net_ns(clnt);
114 if (pipefs_sb == clnt->pipefs_sb)
115 __rpc_clnt_remove_pipedir(clnt);
121 struct rpc_clnt *clnt)
124 const char *dir_name = clnt->cl_program->pipe_dir_name;
134 snprintf(name, sizeof(name), "clnt%x", (unsigned int)clntid++);
136 dentry = rpc_create_client_dir(dir, name, clnt);
151 rpc_setup_pipedir(struct super_block *pipefs_sb, struct rpc_clnt *clnt)
155 clnt->pipefs_sb = pipefs_sb;
157 if (clnt->cl_program->pipe_dir_name != NULL) {
158 dentry = rpc_setup_pipedir_sb(pipefs_sb, clnt);
165 static int rpc_clnt_skip_event(struct rpc_clnt *clnt, unsigned long event)
167 if (clnt->cl_program->pipe_dir_name == NULL)
172 if (clnt->cl_pipedir_objects.pdh_dentry != NULL)
174 if (refcount_read(&clnt->cl_count) == 0)
178 if (clnt->cl_pipedir_objects.pdh_dentry == NULL)
185 static int __rpc_clnt_handle_event(struct rpc_clnt *clnt, unsigned long event,
192 dentry = rpc_setup_pipedir_sb(sb, clnt);
199 __rpc_clnt_remove_pipedir(clnt);
208 static int __rpc_pipefs_event(struct rpc_clnt *clnt, unsigned long event,
213 for (;; clnt = clnt->cl_parent) {
214 if (!rpc_clnt_skip_event(clnt, event))
215 error = __rpc_clnt_handle_event(clnt, event, sb);
216 if (error || clnt == clnt->cl_parent)
225 struct rpc_clnt *clnt;
228 list_for_each_entry(clnt, &sn->all_clients, cl_clients) {
229 if (rpc_clnt_skip_event(clnt, event))
232 return clnt;
242 struct rpc_clnt *clnt;
245 while ((clnt = rpc_get_client_for_event(sb->s_fs_info, event))) {
246 error = __rpc_pipefs_event(clnt, event, sb);
268 static struct rpc_xprt *rpc_clnt_set_transport(struct rpc_clnt *clnt,
274 spin_lock(&clnt->cl_lock);
275 old = rcu_dereference_protected(clnt->cl_xprt,
276 lockdep_is_held(&clnt->cl_lock));
279 clnt->cl_autobind = 1;
281 clnt->cl_timeout = timeout;
282 rcu_assign_pointer(clnt->cl_xprt, xprt);
283 spin_unlock(&clnt->cl_lock);
288 static void rpc_clnt_set_nodename(struct rpc_clnt *clnt, const char *nodename)
292 copied = strscpy(clnt->cl_nodename,
293 nodename, sizeof(clnt->cl_nodename));
295 clnt->cl_nodelen = copied < 0
296 ? sizeof(clnt->cl_nodename) - 1
300 static int rpc_client_register(struct rpc_clnt *clnt,
309 struct net *net = rpc_net_ns(clnt);
313 rpc_clnt_debugfs_register(clnt);
317 err = rpc_setup_pipedir(pipefs_sb, clnt);
322 rpc_register_client(clnt);
326 auth = rpcauth_create(&auth_args, clnt);
336 rpc_unregister_client(clnt);
337 __rpc_clnt_remove_pipedir(clnt);
341 rpc_sysfs_client_destroy(clnt);
342 rpc_clnt_debugfs_unregister(clnt);
353 static int rpc_alloc_clid(struct rpc_clnt *clnt)
360 clnt->cl_clid = clid;
364 static void rpc_free_clid(struct rpc_clnt *clnt)
366 ida_free(&rpc_clids, clnt->cl_clid);
376 struct rpc_clnt *clnt = NULL;
393 clnt = kzalloc(sizeof(*clnt), GFP_KERNEL);
394 if (!clnt)
396 clnt->cl_parent = parent ? : clnt;
397 clnt->cl_xprtsec = args->xprtsec;
399 err = rpc_alloc_clid(clnt);
403 clnt->cl_cred = get_cred(args->cred);
404 clnt->cl_procinfo = version->procs;
405 clnt->cl_maxproc = version->nrprocs;
406 clnt->cl_prog = args->prognumber ? : program->number;
407 clnt->cl_vers = version->number;
408 clnt->cl_stats = args->stats ? : program->stats;
409 clnt->cl_metrics = rpc_alloc_iostats(clnt);
410 rpc_init_pipe_dir_head(&clnt->cl_pipedir_objects);
412 if (clnt->cl_metrics == NULL)
414 clnt->cl_program = program;
415 INIT_LIST_HEAD(&clnt->cl_tasks);
416 spin_lock_init(&clnt->cl_lock);
420 memcpy(&clnt->cl_timeout_default, args->timeout,
421 sizeof(clnt->cl_timeout_default));
422 timeout = &clnt->cl_timeout_default;
425 rpc_clnt_set_transport(clnt, xprt, timeout);
427 xprt_iter_init(&clnt->cl_xpi, xps);
430 clnt->cl_rtt = &clnt->cl_rtt_default;
431 rpc_init_rtt(&clnt->cl_rtt_default, clnt->cl_timeout->to_initval);
433 refcount_set(&clnt->cl_count, 1);
438 rpc_clnt_set_nodename(clnt, nodename);
440 rpc_sysfs_client_setup(clnt, xps, rpc_net_ns(clnt));
441 err = rpc_client_register(clnt, args->authflavor, args->client_name);
447 trace_rpc_clnt_new(clnt, xprt, args);
448 return clnt;
451 rpc_free_iostats(clnt->cl_metrics);
453 put_cred(clnt->cl_cred);
454 rpc_free_clid(clnt);
456 kfree(clnt);
469 struct rpc_clnt *clnt = NULL;
487 clnt = rpc_new_client(args, xps, xprt, NULL);
488 if (IS_ERR(clnt))
489 return clnt;
492 int err = rpc_ping(clnt);
494 rpc_shutdown_client(clnt);
498 int err = rpc_ping_noreply(clnt);
500 rpc_shutdown_client(clnt);
505 clnt->cl_softrtry = 1;
507 clnt->cl_softrtry = 0;
509 clnt->cl_softerr = 1;
513 clnt->cl_autobind = 1;
515 clnt->cl_noretranstimeo = 1;
517 clnt->cl_discrtry = 1;
519 clnt->cl_chatty = 1;
521 return clnt;
550 struct rpc_clnt *clnt;
621 clnt = rpc_create_xprt(args, xprt);
622 if (IS_ERR(clnt) || args->nconnect <= 1)
623 return clnt;
626 if (rpc_clnt_add_xprt(clnt, &xprtargs, NULL, NULL) < 0)
629 return clnt;
639 struct rpc_clnt *clnt)
648 xprt = xprt_get(rcu_dereference(clnt->cl_xprt));
649 xps = xprt_switch_get(rcu_dereference(clnt->cl_xpi.xpi_xpswitch));
657 args->nodename = clnt->cl_nodename;
659 new = rpc_new_client(args, xps, xprt, clnt);
665 new->cl_softrtry = clnt->cl_softrtry;
666 new->cl_softerr = clnt->cl_softerr;
667 new->cl_noretranstimeo = clnt->cl_noretranstimeo;
668 new->cl_discrtry = clnt->cl_discrtry;
669 new->cl_chatty = clnt->cl_chatty;
670 new->cl_principal = clnt->cl_principal;
671 new->cl_max_connect = clnt->cl_max_connect;
675 trace_rpc_clnt_clone_err(clnt, err);
682 * @clnt: RPC client whose parameters are copied
686 struct rpc_clnt *rpc_clone_client(struct rpc_clnt *clnt)
689 .program = clnt->cl_program,
690 .prognumber = clnt->cl_prog,
691 .version = clnt->cl_vers,
692 .authflavor = clnt->cl_auth->au_flavor,
693 .cred = clnt->cl_cred,
694 .stats = clnt->cl_stats,
696 return __rpc_clone_client(&args, clnt);
703 * @clnt: RPC client whose parameters are copied
709 rpc_clone_client_set_auth(struct rpc_clnt *clnt, rpc_authflavor_t flavor)
712 .program = clnt->cl_program,
713 .prognumber = clnt->cl_prog,
714 .version = clnt->cl_vers,
716 .cred = clnt->cl_cred,
717 .stats = clnt->cl_stats,
719 return __rpc_clone_client(&args, clnt);
725 * @clnt: pointer to a struct rpc_clnt
730 * rpc_clnt structure 'clnt' to allow it to connect to a mirrored NFS
734 * Returns zero if "clnt" is now using the new xprt. Otherwise a
735 * negative errno is returned, and "clnt" continues to use the old
738 int rpc_switch_client_transport(struct rpc_clnt *clnt,
749 args->xprtsec = clnt->cl_xprtsec;
760 pseudoflavor = clnt->cl_auth->au_flavor;
762 old_timeo = clnt->cl_timeout;
763 old = rpc_clnt_set_transport(clnt, xprt, timeout);
764 oldxps = xprt_iter_xchg_switch(&clnt->cl_xpi, xps);
766 rpc_unregister_client(clnt);
767 __rpc_clnt_remove_pipedir(clnt);
768 rpc_sysfs_client_destroy(clnt);
769 rpc_clnt_debugfs_unregister(clnt);
772 * A new transport was created. "clnt" therefore
773 * becomes the root of a new cl_parent tree. clnt's
776 parent = clnt->cl_parent;
777 clnt->cl_parent = clnt;
784 err = rpc_client_register(clnt, pseudoflavor, NULL);
789 if (parent != clnt)
793 trace_rpc_clnt_replace_xprt(clnt);
797 xps = xprt_iter_xchg_switch(&clnt->cl_xpi, oldxps);
798 rpc_clnt_set_transport(clnt, old, old_timeo);
799 clnt->cl_parent = parent;
800 rpc_client_register(clnt, pseudoflavor, NULL);
803 trace_rpc_clnt_replace_xprt_err(clnt);
808 static struct rpc_xprt_switch *rpc_clnt_xprt_switch_get(struct rpc_clnt *clnt)
813 xps = xprt_switch_get(rcu_dereference(clnt->cl_xpi.xpi_xpswitch));
820 int _rpc_clnt_xprt_iter_init(struct rpc_clnt *clnt, struct rpc_xprt_iter *xpi,
825 xps = rpc_clnt_xprt_switch_get(clnt);
834 int rpc_clnt_xprt_iter_init(struct rpc_clnt *clnt, struct rpc_xprt_iter *xpi)
836 return _rpc_clnt_xprt_iter_init(clnt, xpi, xprt_iter_init_listall);
840 int rpc_clnt_xprt_iter_offline_init(struct rpc_clnt *clnt,
843 return _rpc_clnt_xprt_iter_init(clnt, xpi, xprt_iter_init_listoffline);
848 * @clnt: pointer to client
853 * client and applies the function fn(clnt, xprt, data).
857 int rpc_clnt_iterate_for_each_xprt(struct rpc_clnt *clnt,
864 ret = rpc_clnt_xprt_iter_init(clnt, &xpi);
872 ret = fn(clnt, xprt, data);
886 void rpc_killall_tasks(struct rpc_clnt *clnt)
891 if (list_empty(&clnt->cl_tasks))
897 trace_rpc_clnt_killall(clnt);
898 spin_lock(&clnt->cl_lock);
899 list_for_each_entry(rovr, &clnt->cl_tasks, tk_task)
901 spin_unlock(&clnt->cl_lock);
907 * @clnt: Pointer to RPC client
915 unsigned long rpc_cancel_tasks(struct rpc_clnt *clnt, int error,
923 if (list_empty(&clnt->cl_tasks))
928 spin_lock(&clnt->cl_lock);
929 list_for_each_entry(task, &clnt->cl_tasks, tk_task) {
937 spin_unlock(&clnt->cl_lock);
942 static int rpc_clnt_disconnect_xprt(struct rpc_clnt *clnt,
950 void rpc_clnt_disconnect(struct rpc_clnt *clnt)
952 rpc_clnt_iterate_for_each_xprt(clnt, rpc_clnt_disconnect_xprt, NULL);
960 void rpc_shutdown_client(struct rpc_clnt *clnt)
964 trace_rpc_clnt_shutdown(clnt);
966 while (!list_empty(&clnt->cl_tasks)) {
967 rpc_killall_tasks(clnt);
969 list_empty(&clnt->cl_tasks), 1*HZ);
972 rpc_release_client(clnt);
981 struct rpc_clnt *clnt = container_of(work, struct rpc_clnt, cl_work);
983 trace_rpc_clnt_free(clnt);
989 rpc_sysfs_client_destroy(clnt);
990 rpc_clnt_debugfs_unregister(clnt);
991 rpc_free_clid(clnt);
992 rpc_clnt_remove_pipedir(clnt);
993 xprt_put(rcu_dereference_raw(clnt->cl_xprt));
995 kfree(clnt);
999 rpc_free_client(struct rpc_clnt *clnt)
1003 trace_rpc_clnt_release(clnt);
1004 if (clnt->cl_parent != clnt)
1005 parent = clnt->cl_parent;
1006 rpc_unregister_client(clnt);
1007 rpc_free_iostats(clnt->cl_metrics);
1008 clnt->cl_metrics = NULL;
1009 xprt_iter_destroy(&clnt->cl_xpi);
1010 put_cred(clnt->cl_cred);
1012 INIT_WORK(&clnt->cl_work, rpc_free_client_work);
1013 schedule_work(&clnt->cl_work);
1021 rpc_free_auth(struct rpc_clnt *clnt)
1028 if (clnt->cl_auth != NULL) {
1029 rpcauth_release(clnt->cl_auth);
1030 clnt->cl_auth = NULL;
1032 if (refcount_dec_and_test(&clnt->cl_count))
1033 return rpc_free_client(clnt);
1041 rpc_release_client(struct rpc_clnt *clnt)
1044 if (list_empty(&clnt->cl_tasks))
1046 if (refcount_dec_not_one(&clnt->cl_count))
1048 clnt = rpc_free_auth(clnt);
1049 } while (clnt != NULL);
1075 struct rpc_clnt *clnt;
1078 clnt = __rpc_clone_client(&args, old);
1079 if (IS_ERR(clnt))
1081 err = rpc_ping(clnt);
1083 rpc_shutdown_client(clnt);
1084 clnt = ERR_PTR(err);
1087 return clnt;
1092 rpc_task_get_xprt(struct rpc_clnt *clnt, struct rpc_xprt *xprt)
1099 xps = rcu_dereference(clnt->cl_xpi.xpi_xpswitch);
1108 rpc_task_release_xprt(struct rpc_clnt *clnt, struct rpc_xprt *xprt)
1114 xps = rcu_dereference(clnt->cl_xpi.xpi_xpswitch);
1137 struct rpc_clnt *clnt = task->tk_client;
1140 if (clnt != NULL) {
1142 spin_lock(&clnt->cl_lock);
1144 spin_unlock(&clnt->cl_lock);
1147 rpc_release_client(clnt);
1152 rpc_task_get_first_xprt(struct rpc_clnt *clnt)
1157 xprt = xprt_get(rcu_dereference(clnt->cl_xprt));
1159 return rpc_task_get_xprt(clnt, xprt);
1163 rpc_task_get_next_xprt(struct rpc_clnt *clnt)
1165 return rpc_task_get_xprt(clnt, xprt_iter_get_next(&clnt->cl_xpi));
1169 void rpc_task_set_transport(struct rpc_task *task, struct rpc_clnt *clnt)
1179 task->tk_xprt = rpc_task_get_first_xprt(clnt);
1181 task->tk_xprt = rpc_task_get_next_xprt(clnt);
1185 void rpc_task_set_client(struct rpc_task *task, struct rpc_clnt *clnt)
1187 rpc_task_set_transport(task, clnt);
1188 task->tk_client = clnt;
1189 refcount_inc(&clnt->cl_count);
1190 if (clnt->cl_softrtry)
1192 if (clnt->cl_softerr)
1194 if (clnt->cl_noretranstimeo)
1197 spin_lock(&clnt->cl_lock);
1198 list_add_tail(&task->tk_task, &clnt->cl_tasks);
1199 spin_unlock(&clnt->cl_lock);
1256 * @clnt: pointer to RPC client
1260 int rpc_call_sync(struct rpc_clnt *clnt, const struct rpc_message *msg, int flags)
1264 .rpc_client = clnt,
1289 * @clnt: pointer to RPC client
1296 rpc_call_async(struct rpc_clnt *clnt, const struct rpc_message *msg, int flags,
1301 .rpc_client = clnt,
1385 * rpc_peeraddr - extract remote peer address from clnt's xprt
1386 * @clnt: RPC client structure
1392 size_t rpc_peeraddr(struct rpc_clnt *clnt, struct sockaddr *buf, size_t bufsize)
1398 xprt = rcu_dereference(clnt->cl_xprt);
1412 * @clnt: RPC client structure
1419 const char *rpc_peeraddr2str(struct rpc_clnt *clnt,
1424 xprt = rcu_dereference(clnt->cl_xprt);
1543 * @clnt: RPC client structure
1557 int rpc_localaddr(struct rpc_clnt *clnt, struct sockaddr *buf, size_t buflen)
1567 xprt = rcu_dereference(clnt->cl_xprt);
1584 rpc_setbufsize(struct rpc_clnt *clnt, unsigned int sndsize, unsigned int rcvsize)
1589 xprt = rcu_dereference(clnt->cl_xprt);
1598 * @clnt: RPC client to query
1601 struct net *rpc_net_ns(struct rpc_clnt *clnt)
1606 ret = rcu_dereference(clnt->cl_xprt)->xprt_net;
1614 * @clnt: RPC client to query
1621 size_t rpc_max_payload(struct rpc_clnt *clnt)
1626 ret = rcu_dereference(clnt->cl_xprt)->max_payload;
1634 * @clnt: RPC client to query
1636 size_t rpc_max_bc_payload(struct rpc_clnt *clnt)
1642 xprt = rcu_dereference(clnt->cl_xprt);
1649 unsigned int rpc_num_bc_slots(struct rpc_clnt *clnt)
1655 xprt = rcu_dereference(clnt->cl_xprt);
1664 * @clnt: client to rebind
1667 void rpc_force_rebind(struct rpc_clnt *clnt)
1669 if (clnt->cl_autobind) {
1671 xprt_clear_bound(rcu_dereference(clnt->cl_xprt));
1747 struct rpc_clnt *clnt = task->tk_client;
1758 if (clnt->cl_program->version[clnt->cl_vers])
1759 clnt->cl_program->version[clnt->cl_vers]->counts[idx]++;
1760 clnt->cl_stats->rpccnt++;
1762 rpc_task_set_transport(task, clnt);
2175 struct rpc_clnt *clnt = task->tk_client;
2186 clnt->cl_stats->netreconn++;
2201 if (clnt->cl_autobind) {
2202 rpc_force_rebind(clnt);
2229 xps = rpc_clnt_xprt_switch_get(clnt);
2444 struct rpc_clnt *clnt = task->tk_client;
2478 rpc_force_rebind(clnt);
2495 if (clnt->cl_chatty)
2497 clnt->cl_program->name, -status);
2519 struct rpc_clnt *clnt = task->tk_client;
2545 if (clnt->cl_chatty) {
2548 clnt->cl_program->name,
2560 if (clnt->cl_chatty) {
2563 clnt->cl_program->name,
2567 rpc_force_rebind(clnt);
2581 struct rpc_clnt *clnt = task->tk_client;
2592 if (clnt->cl_chatty) {
2594 clnt->cl_program->name,
2650 struct rpc_clnt *clnt = task->tk_client;
2662 *p++ = cpu_to_be32(clnt->cl_prog);
2663 *p++ = cpu_to_be32(clnt->cl_vers);
2679 struct rpc_clnt *clnt = task->tk_client;
2732 clnt->cl_stats->rpcgarbage++;
2842 struct rpc_task *rpc_call_null_helper(struct rpc_clnt *clnt,
2850 .rpc_client = clnt,
2863 struct rpc_task *rpc_call_null(struct rpc_clnt *clnt, struct rpc_cred *cred, int flags)
2865 return rpc_call_null_helper(clnt, NULL, cred, flags, NULL, NULL);
2869 static int rpc_ping(struct rpc_clnt *clnt)
2874 if (clnt->cl_auth->au_ops->ping)
2875 return clnt->cl_auth->au_ops->ping(clnt);
2877 task = rpc_call_null_helper(clnt, NULL, NULL, 0, NULL, NULL);
2885 static int rpc_ping_noreply(struct rpc_clnt *clnt)
2891 .rpc_client = clnt,
2937 * @clnt: pointer to struct rpc_clnt
2942 int rpc_clnt_test_and_add_xprt(struct rpc_clnt *clnt,
2948 int max_connect = clnt->cl_max_connect;
2956 rpc_peeraddr2str(clnt, RPC_DISPLAY_ADDR));
2971 task = rpc_call_null_helper(clnt, xprt, NULL, RPC_TASK_ASYNC,
2983 static int rpc_clnt_add_xprt_helper(struct rpc_clnt *clnt,
2991 task = rpc_call_null_helper(clnt, xprt, NULL, 0, NULL, NULL);
3002 data->add_xprt_test(clnt, xprt, data->data);
3019 * @clnt: struct rpc_clnt to get the new transport
3025 int rpc_clnt_setup_test_and_add_xprt(struct rpc_clnt *clnt,
3038 status = rpc_clnt_add_xprt_helper(clnt, xprt, data);
3057 * @clnt: pointer to struct rpc_clnt
3063 * adds it to clnt.
3068 int rpc_clnt_add_xprt(struct rpc_clnt *clnt,
3084 xps = xprt_switch_get(rcu_dereference(clnt->cl_xpi.xpi_xpswitch));
3085 xprt = xprt_iter_xprt(&clnt->cl_xpi);
3100 xprtargs->xprtsec = clnt->cl_xprtsec;
3120 ret = setup(clnt, xps, xprt, data);
3133 static int rpc_xprt_probe_trunked(struct rpc_clnt *clnt,
3143 main_xprt = xprt_get(rcu_dereference(clnt->cl_xprt));
3151 status = rpc_clnt_add_xprt_helper(clnt, xprt, data);
3158 * @clnt rpc_clnt structure
3164 void rpc_clnt_probe_trunked_xprts(struct rpc_clnt *clnt,
3170 ret = rpc_clnt_xprt_iter_offline_init(clnt, &xpi);
3178 ret = rpc_xprt_probe_trunked(clnt, xprt, data);
3188 static int rpc_xprt_offline(struct rpc_clnt *clnt,
3199 main_xprt = xprt_get(rcu_dereference(clnt->cl_xprt));
3200 xps = xprt_switch_get(rcu_dereference(clnt->cl_xpi.xpi_xpswitch));
3222 * @clnt rpc_clnt structure
3228 void rpc_clnt_manage_trunked_xprts(struct rpc_clnt *clnt)
3230 rpc_clnt_iterate_for_each_xprt(clnt, rpc_xprt_offline, NULL);
3240 rpc_xprt_set_connect_timeout(struct rpc_clnt *clnt,
3254 rpc_set_connect_timeout(struct rpc_clnt *clnt,
3262 rpc_clnt_iterate_for_each_xprt(clnt,
3268 void rpc_clnt_xprt_set_online(struct rpc_clnt *clnt, struct rpc_xprt *xprt)
3272 xps = rpc_clnt_xprt_switch_get(clnt);
3277 void rpc_clnt_xprt_switch_add_xprt(struct rpc_clnt *clnt, struct rpc_xprt *xprt)
3281 if (rpc_clnt_xprt_switch_has_addr(clnt,
3283 return rpc_clnt_xprt_set_online(clnt, xprt);
3286 xps = rpc_clnt_xprt_switch_get(clnt);
3292 void rpc_clnt_xprt_switch_remove_xprt(struct rpc_clnt *clnt, struct rpc_xprt *xprt)
3297 xps = rcu_dereference(clnt->cl_xpi.xpi_xpswitch);
3298 rpc_xprt_switch_remove_xprt(rcu_dereference(clnt->cl_xpi.xpi_xpswitch),
3305 bool rpc_clnt_xprt_switch_has_addr(struct rpc_clnt *clnt,
3312 xps = rcu_dereference(clnt->cl_xpi.xpi_xpswitch);
3326 static void rpc_show_task(const struct rpc_clnt *clnt,
3336 clnt, task->tk_rqstp, rpc_task_timeout(task), task->tk_ops,
3337 clnt->cl_program->name, clnt->cl_vers, rpc_proc_name(task),
3343 struct rpc_clnt *clnt;
3349 list_for_each_entry(clnt, &sn->all_clients, cl_clients) {
3350 spin_lock(&clnt->cl_lock);
3351 list_for_each_entry(task, &clnt->cl_tasks, tk_task) {
3356 rpc_show_task(clnt, task);
3358 spin_unlock(&clnt->cl_lock);
3366 rpc_clnt_swap_activate_callback(struct rpc_clnt *clnt,
3374 rpc_clnt_swap_activate(struct rpc_clnt *clnt)
3376 while (clnt != clnt->cl_parent)
3377 clnt = clnt->cl_parent;
3378 if (atomic_inc_return(&clnt->cl_swapper) == 1)
3379 return rpc_clnt_iterate_for_each_xprt(clnt,
3386 rpc_clnt_swap_deactivate_callback(struct rpc_clnt *clnt,
3395 rpc_clnt_swap_deactivate(struct rpc_clnt *clnt)
3397 while (clnt != clnt->cl_parent)
3398 clnt = clnt->cl_parent;
3399 if (atomic_dec_if_positive(&clnt->cl_swapper) == 0)
3400 rpc_clnt_iterate_for_each_xprt(clnt,