From 9fa496d11ff2a361b4693034f6caad90da995312 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Fri, 8 Oct 2010 15:39:21 -0500 Subject: [PATCH] RX: Add rx_InterruptCall Add rx_InterruptCall, to cause a call to error out and wakeup anyone waiting to write or read to that call. Change-Id: I0747ac9107dac6b9a6d8b8c59120a756416aad58 Reviewed-on: http://gerrit.openafs.org/2982 Reviewed-by: Derrick Brashear Reviewed-by: Jeffrey Altman Reviewed-by: Tom Keiser Tested-by: Derrick Brashear --- src/libafsrpc/afsrpc.def | 1 + src/rx/rx.c | 15 +++++++++++++++ src/rx/rx_prototypes.h | 1 + src/shlibafsrpc/libafsrpc.map | 1 + 4 files changed, 18 insertions(+) diff --git a/src/libafsrpc/afsrpc.def b/src/libafsrpc/afsrpc.def index 0c9c2222e..2a0a15a38 100755 --- a/src/libafsrpc/afsrpc.def +++ b/src/libafsrpc/afsrpc.def @@ -266,6 +266,7 @@ EXPORTS rx_FreeStatistics @271 rx_SetConnHardDeadTime @272 rx_SetConnIdleDeadTime @273 + rx_InterruptCall @274 ; for performance testing rx_TSFPQGlobSize @2001 DATA diff --git a/src/rx/rx.c b/src/rx/rx.c index 775fd6235..f65df8b83 100644 --- a/src/rx/rx.c +++ b/src/rx/rx.c @@ -4936,6 +4936,21 @@ rxi_ConnectionError(struct rx_connection *conn, } } +/** + * Interrupt an in-progress call with the specified error and wakeup waiters. + * + * @param[in] call The call to interrupt + * @param[in] error The error code to send to the peer + */ +void +rx_InterruptCall(struct rx_call *call, afs_int32 error) +{ + MUTEX_ENTER(&call->lock); + rxi_CallError(call, error); + rxi_SendCallAbort(call, NULL, 0, 1); + MUTEX_EXIT(&call->lock); +} + void rxi_CallError(struct rx_call *call, afs_int32 error) { diff --git a/src/rx/rx_prototypes.h b/src/rx/rx_prototypes.h index 4dba7c61e..7fcfc2933 100644 --- a/src/rx/rx_prototypes.h +++ b/src/rx/rx_prototypes.h @@ -80,6 +80,7 @@ extern void rx_SetArrivalProc(struct rx_call *call, int index), void * handle, int arg); extern afs_int32 rx_EndCall(struct rx_call *call, afs_int32 rc); +extern void rx_InterruptCall(struct rx_call *call, afs_int32 error); extern void rx_Finalize(void); extern void rxi_PacketsUnWait(void); extern struct rx_service *rxi_FindService(osi_socket socket, diff --git a/src/shlibafsrpc/libafsrpc.map b/src/shlibafsrpc/libafsrpc.map index 992e8d327..adc68428b 100755 --- a/src/shlibafsrpc/libafsrpc.map +++ b/src/shlibafsrpc/libafsrpc.map @@ -164,6 +164,7 @@ rx_identity_new; rx_identity_freeContents; rx_identity_free; + rx_InterruptCall; local: *; }; -- 2.39.5