]> 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>
Mon, 18 Oct 2010 17:19:54 +0000 (10:19 -0700)
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 <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Tested-by: Derrick Brashear <shadow@dementia.org>
src/libafsrpc/afsrpc.def
src/rx/rx.c
src/rx/rx_prototypes.h
src/shlibafsrpc/libafsrpc.map

index 0c9c2222e0486f91c495241687ee7c9a73b5f4b9..2a0a15a380efc94cdd1863c025e0c749cf8134c9 100755 (executable)
@@ -266,6 +266,7 @@ EXPORTS
         rx_FreeStatistics                       @271
        rx_SetConnHardDeadTime                  @272
        rx_SetConnIdleDeadTime                  @273
+       rx_InterruptCall                        @274
 
 ; for performance testing
         rx_TSFPQGlobSize                        @2001 DATA
index 775fd62351ee87210afc686ece3b73cf5789195d..f65df8b831194e759268c39284473d6196dd0744 100644 (file)
@@ -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)
 {
index 4dba7c61e77cae20249d166144853387de9e4082..7fcfc2933e16f5aa0c20be2246c4a55a52bebc30 100644 (file)
@@ -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,
index 992e8d327064babeeb3b43869679a90e733d1ec2..adc68428bcea5850d2ba7f5532564c3664993425 100755 (executable)
        rx_identity_new;
        rx_identity_freeContents;
        rx_identity_free;
+       rx_InterruptCall;
     local:
        *;
 };