From 608b568a8956469df419d1b48917444d7cd1a594 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. Reviewed-on: http://gerrit.openafs.org/2982 Reviewed-by: Derrick Brashear Reviewed-by: Jeffrey Altman Reviewed-by: Tom Keiser Tested-by: Derrick Brashear (cherry picked from commit 9fa496d11ff2a361b4693034f6caad90da995312) Change-Id: I2e0f5eb2942830523b19d2596c50d0fba0fc9a1a Reviewed-on: http://gerrit.openafs.org/3248 Tested-by: Derrick Brashear Reviewed-by: Derrick Brashear --- src/libafsrpc/afsrpc.def | 2 +- src/rx/rx.c | 15 +++++++++++++++ src/rx/rx_prototypes.h | 1 + src/shlibafsrpc/libafsrpc.map | 1 + 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/libafsrpc/afsrpc.def b/src/libafsrpc/afsrpc.def index dd6fd0cfb9..ef1d0f53a8 100755 --- a/src/libafsrpc/afsrpc.def +++ b/src/libafsrpc/afsrpc.def @@ -266,7 +266,7 @@ EXPORTS ; rx_FreeStatistics @271 rx_SetConnHardDeadTime @272 rx_SetConnIdleDeadTime @273 -; rx_InterruptCall @274 + rx_InterruptCall @274 osi_Panic @275 ; lwp functions diff --git a/src/rx/rx.c b/src/rx/rx.c index 378cb176b0..dc993fcca6 100644 --- a/src/rx/rx.c +++ b/src/rx/rx.c @@ -4918,6 +4918,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 f05fe4ae61..241837aaa9 100644 --- a/src/rx/rx_prototypes.h +++ b/src/rx/rx_prototypes.h @@ -81,6 +81,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 f4eec0f9ee..326b3954ba 100755 --- a/src/shlibafsrpc/libafsrpc.map +++ b/src/shlibafsrpc/libafsrpc.map @@ -142,6 +142,7 @@ afs_xdr_short; afs_xdr_string; afs_xdr_vector; + rx_InterruptCall; local: *; };