afs: release the packets used by rx on shutdown
[openafs.git] / src / rx / rx_globals.h
index b25578b..66dff99 100644 (file)
@@ -235,7 +235,19 @@ EXT struct opr_queue rx_freePacketQueue;
 EXT afs_kmutex_t rx_freePktQ_lock;
 #endif /* RX_ENABLE_LOCKS */
 
-#if defined(AFS_PTHREAD_ENV)
+/*!
+ * \brief Queue of allocated packets.
+ *
+ * This queue is used to keep track of the blocks of allocated packets.
+ * This information is used when afs is being unmounted and the memory
+ * used by those packets needs to be released.
+ */
+EXT struct opr_queue rx_mallocedPacketQueue;
+#ifdef RX_ENABLE_LOCKS
+EXT afs_kmutex_t rx_mallocedPktQ_lock;
+#endif /* RX_ENABLE_LOCKS */
+
+#if defined(AFS_PTHREAD_ENV) && !defined(KERNEL)
 #define RX_ENABLE_TSFPQ
 EXT int rx_TSFPQGlobSize GLOBALSINIT(3); /* number of packets to transfer between global and local queues in one op */
 EXT int rx_TSFPQLocalMax GLOBALSINIT(15); /* max number of packets on local FPQ before returning a glob to the global pool */
@@ -417,7 +429,7 @@ EXT int rx_TSFPQMaxProcs GLOBALSINIT(0); /* max number of threads expected */
         (rx_ts_info_p)->_FPQ.checkin_ops++; \
         (rx_ts_info_p)->_FPQ.checkin_xfer += (num_transfer); \
     } while(0)
-#endif /* AFS_PTHREAD_ENV */
+#endif /* AFS_PTHREAD_ENV && !KERNEL */
 
 /* Number of free packets */
 EXT int rx_nFreePackets GLOBALSINIT(0);
@@ -506,8 +518,8 @@ EXT afs_int32 rxi_availProcs GLOBALSINIT(0);        /* number of threads in the pool */
 EXT afs_int32 rxi_totalMin GLOBALSINIT(0);     /* Sum(minProcs) forall services */
 EXT afs_int32 rxi_minDeficit GLOBALSINIT(0);   /* number of procs needed to handle all minProcs */
 
-EXT int rx_nextCid;            /* Next connection call id */
-EXT int rx_epoch;              /* Initialization time of rx */
+EXT afs_uint32 rx_nextCid;             /* Next connection call id */
+EXT afs_uint32 rx_epoch;               /* Initialization time of rx */
 #ifdef RX_ENABLE_LOCKS
 EXT afs_kcondvar_t rx_waitingForPackets_cv;
 #endif
@@ -528,11 +540,9 @@ EXT afs_kmutex_t rx_connHashTable_lock;
 
 /* Forward definitions of internal procedures */
 #define        rxi_ChallengeOff(conn)  \
-       rxevent_Cancel(&(conn)->challengeEvent, NULL, 0)
-#define rxi_KeepAliveOff(call) \
-       rxevent_Cancel(&(call)->keepAliveEvent, call, RX_CALL_REFCOUNT_ALIVE)
+       rxevent_Cancel(&(conn)->challengeEvent)
 #define rxi_NatKeepAliveOff(conn) \
-       rxevent_Cancel(&(conn)->natKeepAliveEvent, NULL, 0)
+       rxevent_Cancel(&(conn)->natKeepAliveEvent)
 
 #define rxi_AllocSecurityObject() rxi_Alloc(sizeof(struct rx_securityClass))
 #define        rxi_FreeSecurityObject(obj) rxi_Free(obj, sizeof(struct rx_securityClass))