]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
RX: Add rx_InterruptCall
authorAndrew Deason <adeason@sinenomine.net>
Fri, 8 Oct 2010 20:39:21 +0000 (15:39 -0500)
committerDerrick Brashear <shadow@dementia.org>
Wed, 3 Nov 2010 13:01:00 +0000 (06:01 -0700)
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 <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 9fa496d11ff2a361b4693034f6caad90da995312)

Change-Id: I2e0f5eb2942830523b19d2596c50d0fba0fc9a1a
Reviewed-on: http://gerrit.openafs.org/3248
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
src/libafsrpc/afsrpc.def
src/rx/rx.c
src/rx/rx_prototypes.h
src/shlibafsrpc/libafsrpc.map

index dd6fd0cfb9ca2938d0292df831970c87cecd984b..ef1d0f53a86f3b14eb697a3220d159e9f83acf67 100755 (executable)
@@ -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
index 378cb176b07dcdee9f9508132539fd31a9229c03..dc993fcca6ccf70158980159dac5ad21fc7a460f 100644 (file)
@@ -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)
 {
index f05fe4ae618fb8e02dcaad31dc1a8324b4032742..241837aaa9bd3265d50b7bfd95db8ec986f789d2 100644 (file)
@@ -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,
index f4eec0f9ee72f303fb82d6af383b341358fc94aa..326b3954ba89232d5b06701a6703c6c70e386473 100755 (executable)
        afs_xdr_short;
        afs_xdr_string;
        afs_xdr_vector;
+       rx_InterruptCall;
     local:
        *;
 };