]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
fix-tsfpq-20090210
authorJeffrey Altman <jaltman@your-file-system.com>
Tue, 10 Feb 2009 22:42:40 +0000 (22:42 +0000)
committerDerrick Brashear <shadow|account-1000005@unknown>
Thu, 17 Dec 2009 06:23:47 +0000 (22:23 -0800)
LICENSE BSD

avoid transferring more than the number of packets in a queue

Change-Id: I1c2ae660bdaa117aa16f91ca24ce08326bf436a4
Reviewed-on: http://gerrit.openafs.org/926
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
src/rx/rx_globals.h

index e62d35a501bdbfa3302e65fd557ebf5aabf32df8..a6bd88ba3fb3e93262a7c1f139dbf014361a35ee 100644 (file)
@@ -282,9 +282,9 @@ EXT void rxi_FlushLocalPacketsTSFPQ(void); /* flush all thread-local packets to
    rx_freePktQ_lock must be held. default is to reduce the queue size to 40% ofmax */
 #define RX_TS_FPQ_LTOG(rx_ts_info_p) \
     do { \
-        register int i; \
-        register struct rx_packet * p; \
-        register int tsize = (rx_ts_info_p)->_FPQ.len - rx_TSFPQLocalMax + 3 *  rx_TSFPQGlobSize; \
+        int i; \
+        struct rx_packet * p; \
+        int tsize = MIN((rx_ts_info_p)->_FPQ.len, (rx_ts_info_p)->_FPQ.len - rx_TSFPQLocalMax + 3 *  rx_TSFPQGlobSize); \
        if (tsize <= 0) break; \
         for (i=0,p=queue_Last(&((rx_ts_info_p)->_FPQ), rx_packet); \
              i < tsize; i++,p=queue_Prev(p, rx_packet)); \