Lines Matching full:server

18 static void afs_finished_vl_probe(struct afs_vlserver *server)  in afs_finished_vl_probe()  argument
20 if (!(server->probe.flags & AFS_VLSERVER_PROBE_RESPONDED)) { in afs_finished_vl_probe()
21 server->rtt = UINT_MAX; in afs_finished_vl_probe()
22 clear_bit(AFS_VLSERVER_FL_RESPONDING, &server->flags); in afs_finished_vl_probe()
25 clear_bit_unlock(AFS_VLSERVER_FL_PROBING, &server->flags); in afs_finished_vl_probe()
26 wake_up_bit(&server->flags, AFS_VLSERVER_FL_PROBING); in afs_finished_vl_probe()
32 static void afs_done_one_vl_probe(struct afs_vlserver *server, bool wake_up) in afs_done_one_vl_probe() argument
34 if (atomic_dec_and_test(&server->probe_outstanding)) { in afs_done_one_vl_probe()
35 afs_finished_vl_probe(server); in afs_done_one_vl_probe()
40 wake_up_all(&server->probe_wq); in afs_done_one_vl_probe()
50 struct afs_vlserver *server = call->vlserver; in afs_vlserver_probe_result() local
58 _enter("%s,%u,%u,%d,%d", server->name, server_index, index, ret, call->abort_code); in afs_vlserver_probe_result()
60 spin_lock(&server->probe_lock); in afs_vlserver_probe_result()
64 server->probe.error = 0; in afs_vlserver_probe_result()
67 if (!(server->probe.flags & AFS_VLSERVER_PROBE_RESPONDED)) { in afs_vlserver_probe_result()
68 server->probe.abort_code = call->abort_code; in afs_vlserver_probe_result()
69 server->probe.error = ret; in afs_vlserver_probe_result()
77 server->probe.flags |= AFS_VLSERVER_PROBE_LOCAL_FAILURE; in afs_vlserver_probe_result()
78 if (server->probe.error == 0) in afs_vlserver_probe_result()
79 server->probe.error = ret; in afs_vlserver_probe_result()
94 if (!(server->probe.flags & AFS_VLSERVER_PROBE_RESPONDED) && in afs_vlserver_probe_result()
95 (server->probe.error == 0 || in afs_vlserver_probe_result()
96 server->probe.error == -ETIMEDOUT || in afs_vlserver_probe_result()
97 server->probe.error == -ETIME)) in afs_vlserver_probe_result()
98 server->probe.error = ret; in afs_vlserver_probe_result()
108 server->probe.flags |= AFS_VLSERVER_PROBE_IS_YFS; in afs_vlserver_probe_result()
109 set_bit(AFS_VLSERVER_FL_IS_YFS, &server->flags); in afs_vlserver_probe_result()
110 server->service_id = call->service_id; in afs_vlserver_probe_result()
112 server->probe.flags |= AFS_VLSERVER_PROBE_NOT_YFS; in afs_vlserver_probe_result()
113 if (!(server->probe.flags & AFS_VLSERVER_PROBE_IS_YFS)) { in afs_vlserver_probe_result()
114 clear_bit(AFS_VLSERVER_FL_IS_YFS, &server->flags); in afs_vlserver_probe_result()
115 server->service_id = call->service_id; in afs_vlserver_probe_result()
120 if (rtt_us < server->probe.rtt) { in afs_vlserver_probe_result()
121 server->probe.rtt = rtt_us; in afs_vlserver_probe_result()
122 server->rtt = rtt_us; in afs_vlserver_probe_result()
127 server->probe.flags |= AFS_VLSERVER_PROBE_RESPONDED; in afs_vlserver_probe_result()
128 set_bit(AFS_VLSERVER_FL_PROBED, &server->flags); in afs_vlserver_probe_result()
129 set_bit(AFS_VLSERVER_FL_RESPONDING, &server->flags); in afs_vlserver_probe_result()
132 spin_unlock(&server->probe_lock); in afs_vlserver_probe_result()
134 trace_afs_vl_probe(server, false, alist, index, call->error, call->abort_code, rtt_us); in afs_vlserver_probe_result()
139 afs_done_one_vl_probe(server, have_result); in afs_vlserver_probe_result()
147 struct afs_vlserver *server, in afs_do_probe_vlserver() argument
159 _enter("%s", server->name); in afs_do_probe_vlserver()
161 read_lock(&server->lock); in afs_do_probe_vlserver()
162 alist = rcu_dereference_protected(server->addresses, in afs_do_probe_vlserver()
163 lockdep_is_held(&server->lock)); in afs_do_probe_vlserver()
165 read_unlock(&server->lock); in afs_do_probe_vlserver()
167 atomic_set(&server->probe_outstanding, alist->nr_addrs); in afs_do_probe_vlserver()
168 memset(&server->probe, 0, sizeof(server->probe)); in afs_do_probe_vlserver()
169 server->probe.rtt = UINT_MAX; in afs_do_probe_vlserver()
184 trace_afs_vl_probe(server, true, alist, index, 0, 0, 0); in afs_do_probe_vlserver()
185 call = afs_vl_get_capabilities(net, alist, index, key, server, in afs_do_probe_vlserver()
193 afs_done_one_vl_probe(server, false); in afs_do_probe_vlserver()
207 struct afs_vlserver *server; in afs_send_vl_probes() local
213 server = vllist->servers[i].server; in afs_send_vl_probes()
214 if (test_bit(AFS_VLSERVER_FL_PROBED, &server->flags)) in afs_send_vl_probes()
217 if (!test_and_set_bit_lock(AFS_VLSERVER_FL_PROBING, &server->flags) && in afs_send_vl_probes()
218 afs_do_probe_vlserver(net, server, key, i, &e)) in afs_send_vl_probes()
226 * Wait for the first as-yet untried server to respond.
232 struct afs_vlserver *server; in afs_wait_for_vl_probes() local
242 server = vllist->servers[i].server; in afs_wait_for_vl_probes()
243 if (!test_bit(AFS_VLSERVER_FL_PROBING, &server->flags)) in afs_wait_for_vl_probes()
245 if (server->probe.flags & AFS_VLSERVER_PROBE_RESPONDED) in afs_wait_for_vl_probes()
258 server = vllist->servers[i].server; in afs_wait_for_vl_probes()
260 add_wait_queue(&server->probe_wq, &waits[i]); in afs_wait_for_vl_probes()
270 server = vllist->servers[i].server; in afs_wait_for_vl_probes()
271 if (server->probe.flags & AFS_VLSERVER_PROBE_RESPONDED) in afs_wait_for_vl_probes()
273 if (test_bit(AFS_VLSERVER_FL_PROBING, &server->flags)) in afs_wait_for_vl_probes()
288 server = vllist->servers[i].server; in afs_wait_for_vl_probes()
289 rtt_s = READ_ONCE(server->rtt); in afs_wait_for_vl_probes()
290 if (test_bit(AFS_VLSERVER_FL_RESPONDING, &server->flags) && in afs_wait_for_vl_probes()
296 remove_wait_queue(&server->probe_wq, &waits[i]); in afs_wait_for_vl_probes()