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>
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)); \