]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
rx-getputconnection-20041011
authorJeffrey Hutzelman <jhutz@cmu.edu>
Mon, 11 Oct 2004 19:35:30 +0000 (19:35 +0000)
committerDerrick Brashear <shadow@dementia.org>
Mon, 11 Oct 2004 19:35:30 +0000 (19:35 +0000)
FIXES 15584

add Get/PutConnection funcs to diddle conn refCounts.

src/libafsrpc/afsrpc.def
src/rx/rx.c
src/rx/rx.h
src/rx/rx_prototypes.h

index 37cfd4d87dfd6e8156390d2727a054f8ee6429b8..943267bb1d27ede1e6ca4e138a3cb27bf83092f2 100644 (file)
@@ -198,4 +198,5 @@ EXPORTS
        rx_enable_hot_thread                    @203 DATA
        xdr_int64                               @204
        xdr_uint64                              @205
-    rx_SetMaxMTU            @206
+       rx_SetMaxMTU                            @206
+       rx_GetConnection                        @207
index edcaaf3c637e067fd1c8f89b8457f3e475d782ce..c0a3d496b94ea38dabb587c6356ed5610264fe0b 100644 (file)
@@ -1015,6 +1015,20 @@ rx_DestroyConnection(register struct rx_connection *conn)
     USERPRI;
 }
 
+void
+rx_GetConnection(register struct rx_connection *conn)
+{
+    SPLVAR;
+
+    NETPRI;
+    AFS_RXGLOCK();
+    MUTEX_ENTER(&conn->conn_data_lock);
+    conn->refCount++;
+    MUTEX_EXIT(&conn->conn_data_lock);
+    AFS_RXGUNLOCK();
+    USERPRI;
+}
+
 /* Start a new rx remote procedure call, on the specified connection.
  * If wait is set to 1, wait for a free call channel; otherwise return
  * 0.  Maxtime gives the maximum number of seconds this call may take,
index c27fbdb1e79f7ae99bf3bc7f6b4fd4e9f2a5970e..c948c90373f19c58fc3a5537793594dd8889c9c1 100644 (file)
@@ -211,6 +211,8 @@ returned with an error code of RX_CALL_DEAD ( transient error ) */
 #define rx_EnableHotThread()           (rx_enable_hot_thread = 1)
 #define rx_DisableHotThread()          (rx_enable_hot_thread = 0)
 
+#define rx_PutConnection(conn) rx_DestroyConnection(conn)
+
 /* A connection is an authenticated communication path, allowing 
    limited multiple asynchronous conversations. */
 #ifdef KDUMP_RX_LOCK
index f06ec425d8793eea1e333bcd37b93115fb435e4b..6d57e165ef07882ce3a54db9190d79b2892fc4ee 100644 (file)
@@ -26,6 +26,7 @@ extern void rx_SetConnDeadTime(register struct rx_connection *conn,
                               register int seconds);
 extern void rxi_CleanupConnection(struct rx_connection *conn);
 extern void rxi_DestroyConnection(register struct rx_connection *conn);
+extern void rx_GetConnection(register struct rx_connection *conn);
 extern void rx_DestroyConnection(register struct rx_connection *conn);
 extern struct rx_call *rx_NewCall(register struct rx_connection *conn);
 extern int rxi_HasActiveCalls(register struct rx_connection *aconn);