From de6259bb1b330be98ab9f5e8e127d784da74e253 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Tue, 10 Feb 2009 22:42:40 +0000 Subject: [PATCH] fix-tsfpq-20090210 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 Tested-by: Derrick Brashear --- src/rx/rx_globals.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rx/rx_globals.h b/src/rx/rx_globals.h index e62d35a50..a6bd88ba3 100644 --- a/src/rx/rx_globals.h +++ b/src/rx/rx_globals.h @@ -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)); \ -- 2.39.5