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

add Get/PutConnection funcs to diddle conn refCounts.

(cherry picked from commit 3b9cdc23b5122e371139828e557732c5e434230a)

src/rx/rx.c
src/rx/rx.h

index 4a4ea77f08e6a2d0c0bc368e818236a12c90c1e3..47bf37056c91a33d4ae85d034777d0821c9f4b2e 100644 (file)
@@ -993,6 +993,20 @@ void rx_DestroyConnection(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 4c6ff9d5a676165f2e223f853aacc22e5a73e455..48ced3db610369b6d702f333143e0c7e09859dcc 100644 (file)
@@ -253,6 +253,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)
+
 struct rx_securityObjectStats {
     char type;                         /* 0:unk 1:null,2:vab 3:kad */
     char level;