Lines Matching refs:call

105  * route an incoming cache manager call
108 bool afs_cm_incoming_call(struct afs_call *call)
110 _enter("{%u, CB.OP %u}", call->service_id, call->operation_ID);
112 switch (call->operation_ID) {
114 call->type = &afs_SRXCBCallBack;
117 call->type = &afs_SRXCBInitCallBackState;
120 call->type = &afs_SRXCBInitCallBackState3;
123 call->type = &afs_SRXCBProbe;
126 call->type = &afs_SRXCBProbeUuid;
129 call->type = &afs_SRXCBTellMeAboutYourself;
132 if (call->service_id != YFS_CM_SERVICE)
134 call->type = &afs_SRXYFSCB_CallBack;
145 static int afs_find_cm_server_by_peer(struct afs_call *call)
151 peer = rxrpc_kernel_get_call_peer(call->net->socket, call->rxcall);
153 server = afs_find_server(call->net, peer);
155 trace_afs_cm_no_server(call, &srx);
159 call->server = server;
167 static int afs_find_cm_server_by_uuid(struct afs_call *call,
173 server = afs_find_server_by_uuid(call->net, call->request);
176 trace_afs_cm_no_server_u(call, call->request);
180 call->server = server;
185 * Clean up a cache manager call.
187 static void afs_cm_destructor(struct afs_call *call)
189 kfree(call->buffer);
190 call->buffer = NULL;
194 * Abort a service call from within an action function.
196 static void afs_abort_service_call(struct afs_call *call, u32 abort_code, int error,
199 rxrpc_kernel_abort_call(call->net->socket, call->rxcall,
201 afs_set_call_complete(call, error, 0);
209 struct afs_call *call = container_of(work, struct afs_call, work);
217 if (call->server) {
218 trace_afs_server(call->server->debug_id,
219 refcount_read(&call->server->ref),
220 atomic_read(&call->server->active),
222 afs_break_callbacks(call->server, call->count, call->request);
225 afs_send_empty_reply(call);
226 afs_put_call(call);
231 * deliver request data to a CB.CallBack call
233 static int afs_deliver_cb_callback(struct afs_call *call)
239 _enter("{%u}", call->unmarshall);
241 switch (call->unmarshall) {
243 afs_extract_to_tmp(call);
244 call->unmarshall++;
250 ret = afs_extract_data(call, true);
254 call->count = ntohl(call->tmp);
255 _debug("FID count: %u", call->count);
256 if (call->count > AFSCBMAX)
257 return afs_protocol_error(call, afs_eproto_cb_fid_count);
259 call->buffer = kmalloc(array3_size(call->count, 3, 4),
261 if (!call->buffer)
263 afs_extract_to_buf(call, call->count * 3 * 4);
264 call->unmarshall++;
269 ret = afs_extract_data(call, true);
274 call->request = kcalloc(call->count,
277 if (!call->request)
280 cb = call->request;
281 bp = call->buffer;
282 for (loop = call->count; loop > 0; loop--, cb++) {
288 afs_extract_to_tmp(call);
289 call->unmarshall++;
295 ret = afs_extract_data(call, true);
299 call->count2 = ntohl(call->tmp);
300 _debug("CB count: %u", call->count2);
301 if (call->count2 != call->count && call->count2 != 0)
302 return afs_protocol_error(call, afs_eproto_cb_count);
303 call->iter = &call->def_iter;
304 iov_iter_discard(&call->def_iter, ITER_DEST, call->count2 * 3 * 4);
305 call->unmarshall++;
310 iov_iter_count(call->iter), call->count2 * 3 * 4);
312 ret = afs_extract_data(call, false);
316 call->unmarshall++;
323 if (!afs_check_call_state(call, AFS_CALL_SV_REPLYING))
324 return afs_io_error(call, afs_io_error_cm_reply);
328 return afs_find_cm_server_by_peer(call);
336 struct afs_call *call = container_of(work, struct afs_call, work);
338 _enter("{%p}", call->server);
340 if (call->server)
341 afs_init_callback_state(call->server);
342 afs_send_empty_reply(call);
343 afs_put_call(call);
348 * deliver request data to a CB.InitCallBackState call
350 static int afs_deliver_cb_init_call_back_state(struct afs_call *call)
356 afs_extract_discard(call, 0);
357 ret = afs_extract_data(call, false);
363 return afs_find_cm_server_by_peer(call);
367 * deliver request data to a CB.InitCallBackState3 call
369 static int afs_deliver_cb_init_call_back_state3(struct afs_call *call)
378 _enter("{%u}", call->unmarshall);
380 switch (call->unmarshall) {
382 call->buffer = kmalloc_array(11, sizeof(__be32), GFP_KERNEL);
383 if (!call->buffer)
385 afs_extract_to_buf(call, 11 * sizeof(__be32));
386 call->unmarshall++;
391 ret = afs_extract_data(call, false);
399 call->request = kmalloc(sizeof(struct afs_uuid), GFP_KERNEL);
400 if (!call->request)
403 b = call->buffer;
404 r = call->request;
414 call->unmarshall++;
421 if (!afs_check_call_state(call, AFS_CALL_SV_REPLYING))
422 return afs_io_error(call, afs_io_error_cm_reply);
426 return afs_find_cm_server_by_uuid(call, call->request);
434 struct afs_call *call = container_of(work, struct afs_call, work);
437 afs_send_empty_reply(call);
438 afs_put_call(call);
443 * deliver request data to a CB.Probe call
445 static int afs_deliver_cb_probe(struct afs_call *call)
451 afs_extract_discard(call, 0);
452 ret = afs_extract_data(call, false);
456 if (!afs_check_call_state(call, AFS_CALL_SV_REPLYING))
457 return afs_io_error(call, afs_io_error_cm_reply);
458 return afs_find_cm_server_by_peer(call);
467 struct afs_call *call = container_of(work, struct afs_call, work);
468 struct afs_uuid *r = call->request;
472 if (memcmp(r, &call->net->uuid, sizeof(call->net->uuid)) == 0)
473 afs_send_empty_reply(call);
475 afs_abort_service_call(call, 1, 1, afs_abort_probeuuid_negative);
477 afs_put_call(call);
482 * deliver request data to a CB.ProbeUuid call
484 static int afs_deliver_cb_probe_uuid(struct afs_call *call)
491 _enter("{%u}", call->unmarshall);
493 switch (call->unmarshall) {
495 call->buffer = kmalloc_array(11, sizeof(__be32), GFP_KERNEL);
496 if (!call->buffer)
498 afs_extract_to_buf(call, 11 * sizeof(__be32));
499 call->unmarshall++;
504 ret = afs_extract_data(call, false);
512 call->request = kmalloc(sizeof(struct afs_uuid), GFP_KERNEL);
513 if (!call->request)
516 b = call->buffer;
517 r = call->request;
527 call->unmarshall++;
534 if (!afs_check_call_state(call, AFS_CALL_SV_REPLYING))
535 return afs_io_error(call, afs_io_error_cm_reply);
536 return afs_find_cm_server_by_peer(call);
544 struct afs_call *call = container_of(work, struct afs_call, work);
565 reply.ia.uuid[0] = call->net->uuid.time_low;
566 reply.ia.uuid[1] = htonl(ntohs(call->net->uuid.time_mid));
567 reply.ia.uuid[2] = htonl(ntohs(call->net->uuid.time_hi_and_version));
568 reply.ia.uuid[3] = htonl((s8) call->net->uuid.clock_seq_hi_and_reserved);
569 reply.ia.uuid[4] = htonl((s8) call->net->uuid.clock_seq_low);
571 reply.ia.uuid[loop + 5] = htonl((s8) call->net->uuid.node[loop]);
575 afs_send_simple_reply(call, &reply, sizeof(reply));
576 afs_put_call(call);
581 * deliver request data to a CB.TellMeAboutYourself call
583 static int afs_deliver_cb_tell_me_about_yourself(struct afs_call *call)
589 afs_extract_discard(call, 0);
590 ret = afs_extract_data(call, false);
594 if (!afs_check_call_state(call, AFS_CALL_SV_REPLYING))
595 return afs_io_error(call, afs_io_error_cm_reply);
596 return afs_find_cm_server_by_peer(call);
600 * deliver request data to a YFS CB.CallBack call
602 static int afs_deliver_yfs_cb_callback(struct afs_call *call)
609 _enter("{%u}", call->unmarshall);
611 switch (call->unmarshall) {
613 afs_extract_to_tmp(call);
614 call->unmarshall++;
620 ret = afs_extract_data(call, true);
624 call->count = ntohl(call->tmp);
625 _debug("FID count: %u", call->count);
626 if (call->count > YFSCBMAX)
627 return afs_protocol_error(call, afs_eproto_cb_fid_count);
629 size = array_size(call->count, sizeof(struct yfs_xdr_YFSFid));
630 call->buffer = kmalloc(size, GFP_KERNEL);
631 if (!call->buffer)
633 afs_extract_to_buf(call, size);
634 call->unmarshall++;
639 ret = afs_extract_data(call, false);
644 call->request = kcalloc(call->count,
647 if (!call->request)
650 cb = call->request;
651 bp = call->buffer;
652 for (loop = call->count; loop > 0; loop--, cb++) {
660 afs_extract_to_tmp(call);
661 call->unmarshall++;
668 if (!afs_check_call_state(call, AFS_CALL_SV_REPLYING))
669 return afs_io_error(call, afs_io_error_cm_reply);
674 return afs_find_cm_server_by_peer(call);