Lines Matching full:call

105  * route an incoming cache manager call
108 bool afs_cm_incoming_call(struct afs_call *call) in afs_cm_incoming_call() argument
110 _enter("{%u, CB.OP %u}", call->service_id, call->operation_ID); in afs_cm_incoming_call()
112 switch (call->operation_ID) { in afs_cm_incoming_call()
114 call->type = &afs_SRXCBCallBack; in afs_cm_incoming_call()
117 call->type = &afs_SRXCBInitCallBackState; in afs_cm_incoming_call()
120 call->type = &afs_SRXCBInitCallBackState3; in afs_cm_incoming_call()
123 call->type = &afs_SRXCBProbe; in afs_cm_incoming_call()
126 call->type = &afs_SRXCBProbeUuid; in afs_cm_incoming_call()
129 call->type = &afs_SRXCBTellMeAboutYourself; in afs_cm_incoming_call()
132 if (call->service_id != YFS_CM_SERVICE) in afs_cm_incoming_call()
134 call->type = &afs_SRXYFSCB_CallBack; in afs_cm_incoming_call()
145 static int afs_find_cm_server_by_peer(struct afs_call *call) in afs_find_cm_server_by_peer() argument
150 rxrpc_kernel_get_peer(call->net->socket, call->rxcall, &srx); in afs_find_cm_server_by_peer()
152 server = afs_find_server(call->net, &srx); in afs_find_cm_server_by_peer()
154 trace_afs_cm_no_server(call, &srx); in afs_find_cm_server_by_peer()
158 call->server = server; in afs_find_cm_server_by_peer()
166 static int afs_find_cm_server_by_uuid(struct afs_call *call, in afs_find_cm_server_by_uuid() argument
172 server = afs_find_server_by_uuid(call->net, call->request); in afs_find_cm_server_by_uuid()
175 trace_afs_cm_no_server_u(call, call->request); in afs_find_cm_server_by_uuid()
179 call->server = server; in afs_find_cm_server_by_uuid()
184 * Clean up a cache manager call.
186 static void afs_cm_destructor(struct afs_call *call) in afs_cm_destructor() argument
188 kfree(call->buffer); in afs_cm_destructor()
189 call->buffer = NULL; in afs_cm_destructor()
193 * Abort a service call from within an action function.
195 static void afs_abort_service_call(struct afs_call *call, u32 abort_code, int error, in afs_abort_service_call() argument
198 rxrpc_kernel_abort_call(call->net->socket, call->rxcall, in afs_abort_service_call()
200 afs_set_call_complete(call, error, 0); in afs_abort_service_call()
208 struct afs_call *call = container_of(work, struct afs_call, work); in SRXAFSCB_CallBack() local
216 if (call->server) { in SRXAFSCB_CallBack()
217 trace_afs_server(call->server->debug_id, in SRXAFSCB_CallBack()
218 refcount_read(&call->server->ref), in SRXAFSCB_CallBack()
219 atomic_read(&call->server->active), in SRXAFSCB_CallBack()
221 afs_break_callbacks(call->server, call->count, call->request); in SRXAFSCB_CallBack()
224 afs_send_empty_reply(call); in SRXAFSCB_CallBack()
225 afs_put_call(call); in SRXAFSCB_CallBack()
230 * deliver request data to a CB.CallBack call
232 static int afs_deliver_cb_callback(struct afs_call *call) in afs_deliver_cb_callback() argument
238 _enter("{%u}", call->unmarshall); in afs_deliver_cb_callback()
240 switch (call->unmarshall) { in afs_deliver_cb_callback()
242 afs_extract_to_tmp(call); in afs_deliver_cb_callback()
243 call->unmarshall++; in afs_deliver_cb_callback()
249 ret = afs_extract_data(call, true); in afs_deliver_cb_callback()
253 call->count = ntohl(call->tmp); in afs_deliver_cb_callback()
254 _debug("FID count: %u", call->count); in afs_deliver_cb_callback()
255 if (call->count > AFSCBMAX) in afs_deliver_cb_callback()
256 return afs_protocol_error(call, afs_eproto_cb_fid_count); in afs_deliver_cb_callback()
258 call->buffer = kmalloc(array3_size(call->count, 3, 4), in afs_deliver_cb_callback()
260 if (!call->buffer) in afs_deliver_cb_callback()
262 afs_extract_to_buf(call, call->count * 3 * 4); in afs_deliver_cb_callback()
263 call->unmarshall++; in afs_deliver_cb_callback()
268 ret = afs_extract_data(call, true); in afs_deliver_cb_callback()
273 call->request = kcalloc(call->count, in afs_deliver_cb_callback()
276 if (!call->request) in afs_deliver_cb_callback()
279 cb = call->request; in afs_deliver_cb_callback()
280 bp = call->buffer; in afs_deliver_cb_callback()
281 for (loop = call->count; loop > 0; loop--, cb++) { in afs_deliver_cb_callback()
287 afs_extract_to_tmp(call); in afs_deliver_cb_callback()
288 call->unmarshall++; in afs_deliver_cb_callback()
294 ret = afs_extract_data(call, true); in afs_deliver_cb_callback()
298 call->count2 = ntohl(call->tmp); in afs_deliver_cb_callback()
299 _debug("CB count: %u", call->count2); in afs_deliver_cb_callback()
300 if (call->count2 != call->count && call->count2 != 0) in afs_deliver_cb_callback()
301 return afs_protocol_error(call, afs_eproto_cb_count); in afs_deliver_cb_callback()
302 call->iter = &call->def_iter; in afs_deliver_cb_callback()
303 iov_iter_discard(&call->def_iter, ITER_DEST, call->count2 * 3 * 4); in afs_deliver_cb_callback()
304 call->unmarshall++; in afs_deliver_cb_callback()
309 iov_iter_count(call->iter), call->count2 * 3 * 4); in afs_deliver_cb_callback()
311 ret = afs_extract_data(call, false); in afs_deliver_cb_callback()
315 call->unmarshall++; in afs_deliver_cb_callback()
322 if (!afs_check_call_state(call, AFS_CALL_SV_REPLYING)) in afs_deliver_cb_callback()
323 return afs_io_error(call, afs_io_error_cm_reply); in afs_deliver_cb_callback()
327 return afs_find_cm_server_by_peer(call); in afs_deliver_cb_callback()
335 struct afs_call *call = container_of(work, struct afs_call, work); in SRXAFSCB_InitCallBackState() local
337 _enter("{%p}", call->server); in SRXAFSCB_InitCallBackState()
339 if (call->server) in SRXAFSCB_InitCallBackState()
340 afs_init_callback_state(call->server); in SRXAFSCB_InitCallBackState()
341 afs_send_empty_reply(call); in SRXAFSCB_InitCallBackState()
342 afs_put_call(call); in SRXAFSCB_InitCallBackState()
347 * deliver request data to a CB.InitCallBackState call
349 static int afs_deliver_cb_init_call_back_state(struct afs_call *call) in afs_deliver_cb_init_call_back_state() argument
355 afs_extract_discard(call, 0); in afs_deliver_cb_init_call_back_state()
356 ret = afs_extract_data(call, false); in afs_deliver_cb_init_call_back_state()
362 return afs_find_cm_server_by_peer(call); in afs_deliver_cb_init_call_back_state()
366 * deliver request data to a CB.InitCallBackState3 call
368 static int afs_deliver_cb_init_call_back_state3(struct afs_call *call) in afs_deliver_cb_init_call_back_state3() argument
377 _enter("{%u}", call->unmarshall); in afs_deliver_cb_init_call_back_state3()
379 switch (call->unmarshall) { in afs_deliver_cb_init_call_back_state3()
381 call->buffer = kmalloc_array(11, sizeof(__be32), GFP_KERNEL); in afs_deliver_cb_init_call_back_state3()
382 if (!call->buffer) in afs_deliver_cb_init_call_back_state3()
384 afs_extract_to_buf(call, 11 * sizeof(__be32)); in afs_deliver_cb_init_call_back_state3()
385 call->unmarshall++; in afs_deliver_cb_init_call_back_state3()
390 ret = afs_extract_data(call, false); in afs_deliver_cb_init_call_back_state3()
398 call->request = kmalloc(sizeof(struct afs_uuid), GFP_KERNEL); in afs_deliver_cb_init_call_back_state3()
399 if (!call->request) in afs_deliver_cb_init_call_back_state3()
402 b = call->buffer; in afs_deliver_cb_init_call_back_state3()
403 r = call->request; in afs_deliver_cb_init_call_back_state3()
413 call->unmarshall++; in afs_deliver_cb_init_call_back_state3()
420 if (!afs_check_call_state(call, AFS_CALL_SV_REPLYING)) in afs_deliver_cb_init_call_back_state3()
421 return afs_io_error(call, afs_io_error_cm_reply); in afs_deliver_cb_init_call_back_state3()
425 return afs_find_cm_server_by_uuid(call, call->request); in afs_deliver_cb_init_call_back_state3()
433 struct afs_call *call = container_of(work, struct afs_call, work); in SRXAFSCB_Probe() local
436 afs_send_empty_reply(call); in SRXAFSCB_Probe()
437 afs_put_call(call); in SRXAFSCB_Probe()
442 * deliver request data to a CB.Probe call
444 static int afs_deliver_cb_probe(struct afs_call *call) in afs_deliver_cb_probe() argument
450 afs_extract_discard(call, 0); in afs_deliver_cb_probe()
451 ret = afs_extract_data(call, false); in afs_deliver_cb_probe()
455 if (!afs_check_call_state(call, AFS_CALL_SV_REPLYING)) in afs_deliver_cb_probe()
456 return afs_io_error(call, afs_io_error_cm_reply); in afs_deliver_cb_probe()
457 return afs_find_cm_server_by_peer(call); in afs_deliver_cb_probe()
466 struct afs_call *call = container_of(work, struct afs_call, work); in SRXAFSCB_ProbeUuid() local
467 struct afs_uuid *r = call->request; in SRXAFSCB_ProbeUuid()
471 if (memcmp(r, &call->net->uuid, sizeof(call->net->uuid)) == 0) in SRXAFSCB_ProbeUuid()
472 afs_send_empty_reply(call); in SRXAFSCB_ProbeUuid()
474 afs_abort_service_call(call, 1, 1, afs_abort_probeuuid_negative); in SRXAFSCB_ProbeUuid()
476 afs_put_call(call); in SRXAFSCB_ProbeUuid()
481 * deliver request data to a CB.ProbeUuid call
483 static int afs_deliver_cb_probe_uuid(struct afs_call *call) in afs_deliver_cb_probe_uuid() argument
490 _enter("{%u}", call->unmarshall); in afs_deliver_cb_probe_uuid()
492 switch (call->unmarshall) { in afs_deliver_cb_probe_uuid()
494 call->buffer = kmalloc_array(11, sizeof(__be32), GFP_KERNEL); in afs_deliver_cb_probe_uuid()
495 if (!call->buffer) in afs_deliver_cb_probe_uuid()
497 afs_extract_to_buf(call, 11 * sizeof(__be32)); in afs_deliver_cb_probe_uuid()
498 call->unmarshall++; in afs_deliver_cb_probe_uuid()
503 ret = afs_extract_data(call, false); in afs_deliver_cb_probe_uuid()
511 call->request = kmalloc(sizeof(struct afs_uuid), GFP_KERNEL); in afs_deliver_cb_probe_uuid()
512 if (!call->request) in afs_deliver_cb_probe_uuid()
515 b = call->buffer; in afs_deliver_cb_probe_uuid()
516 r = call->request; in afs_deliver_cb_probe_uuid()
526 call->unmarshall++; in afs_deliver_cb_probe_uuid()
533 if (!afs_check_call_state(call, AFS_CALL_SV_REPLYING)) in afs_deliver_cb_probe_uuid()
534 return afs_io_error(call, afs_io_error_cm_reply); in afs_deliver_cb_probe_uuid()
535 return afs_find_cm_server_by_peer(call); in afs_deliver_cb_probe_uuid()
543 struct afs_call *call = container_of(work, struct afs_call, work); in SRXAFSCB_TellMeAboutYourself() local
564 reply.ia.uuid[0] = call->net->uuid.time_low; in SRXAFSCB_TellMeAboutYourself()
565 reply.ia.uuid[1] = htonl(ntohs(call->net->uuid.time_mid)); in SRXAFSCB_TellMeAboutYourself()
566 reply.ia.uuid[2] = htonl(ntohs(call->net->uuid.time_hi_and_version)); in SRXAFSCB_TellMeAboutYourself()
567 reply.ia.uuid[3] = htonl((s8) call->net->uuid.clock_seq_hi_and_reserved); in SRXAFSCB_TellMeAboutYourself()
568 reply.ia.uuid[4] = htonl((s8) call->net->uuid.clock_seq_low); in SRXAFSCB_TellMeAboutYourself()
570 reply.ia.uuid[loop + 5] = htonl((s8) call->net->uuid.node[loop]); in SRXAFSCB_TellMeAboutYourself()
574 afs_send_simple_reply(call, &reply, sizeof(reply)); in SRXAFSCB_TellMeAboutYourself()
575 afs_put_call(call); in SRXAFSCB_TellMeAboutYourself()
580 * deliver request data to a CB.TellMeAboutYourself call
582 static int afs_deliver_cb_tell_me_about_yourself(struct afs_call *call) in afs_deliver_cb_tell_me_about_yourself() argument
588 afs_extract_discard(call, 0); in afs_deliver_cb_tell_me_about_yourself()
589 ret = afs_extract_data(call, false); in afs_deliver_cb_tell_me_about_yourself()
593 if (!afs_check_call_state(call, AFS_CALL_SV_REPLYING)) in afs_deliver_cb_tell_me_about_yourself()
594 return afs_io_error(call, afs_io_error_cm_reply); in afs_deliver_cb_tell_me_about_yourself()
595 return afs_find_cm_server_by_peer(call); in afs_deliver_cb_tell_me_about_yourself()
599 * deliver request data to a YFS CB.CallBack call
601 static int afs_deliver_yfs_cb_callback(struct afs_call *call) in afs_deliver_yfs_cb_callback() argument
608 _enter("{%u}", call->unmarshall); in afs_deliver_yfs_cb_callback()
610 switch (call->unmarshall) { in afs_deliver_yfs_cb_callback()
612 afs_extract_to_tmp(call); in afs_deliver_yfs_cb_callback()
613 call->unmarshall++; in afs_deliver_yfs_cb_callback()
619 ret = afs_extract_data(call, true); in afs_deliver_yfs_cb_callback()
623 call->count = ntohl(call->tmp); in afs_deliver_yfs_cb_callback()
624 _debug("FID count: %u", call->count); in afs_deliver_yfs_cb_callback()
625 if (call->count > YFSCBMAX) in afs_deliver_yfs_cb_callback()
626 return afs_protocol_error(call, afs_eproto_cb_fid_count); in afs_deliver_yfs_cb_callback()
628 size = array_size(call->count, sizeof(struct yfs_xdr_YFSFid)); in afs_deliver_yfs_cb_callback()
629 call->buffer = kmalloc(size, GFP_KERNEL); in afs_deliver_yfs_cb_callback()
630 if (!call->buffer) in afs_deliver_yfs_cb_callback()
632 afs_extract_to_buf(call, size); in afs_deliver_yfs_cb_callback()
633 call->unmarshall++; in afs_deliver_yfs_cb_callback()
638 ret = afs_extract_data(call, false); in afs_deliver_yfs_cb_callback()
643 call->request = kcalloc(call->count, in afs_deliver_yfs_cb_callback()
646 if (!call->request) in afs_deliver_yfs_cb_callback()
649 cb = call->request; in afs_deliver_yfs_cb_callback()
650 bp = call->buffer; in afs_deliver_yfs_cb_callback()
651 for (loop = call->count; loop > 0; loop--, cb++) { in afs_deliver_yfs_cb_callback()
659 afs_extract_to_tmp(call); in afs_deliver_yfs_cb_callback()
660 call->unmarshall++; in afs_deliver_yfs_cb_callback()
667 if (!afs_check_call_state(call, AFS_CALL_SV_REPLYING)) in afs_deliver_yfs_cb_callback()
668 return afs_io_error(call, afs_io_error_cm_reply); in afs_deliver_yfs_cb_callback()
673 return afs_find_cm_server_by_peer(call); in afs_deliver_yfs_cb_callback()