patch-2.4.10 linux/include/net/tcp.h
Next file: linux/include/scsi/sg.h
Previous file: linux/include/net/sock.h
Back to the patch index
Back to the overall index
- Lines: 91
- Date:
Sun Sep 23 10:31:58 2001
- Orig file:
v2.4.9/linux/include/net/tcp.h
- Orig date:
Mon Aug 27 12:41:49 2001
diff -u --recursive --new-file v2.4.9/linux/include/net/tcp.h linux/include/net/tcp.h
@@ -919,12 +919,12 @@
static inline void tcp_initialize_rcv_mss(struct sock *sk)
{
struct tcp_opt *tp = &sk->tp_pinfo.af_tcp;
- unsigned int hint = min(unsigned int, tp->advmss, tp->mss_cache);
+ unsigned int hint = min_t(unsigned int, tp->advmss, tp->mss_cache);
- hint = min(unsigned int, hint, tp->rcv_wnd/2);
+ hint = min_t(unsigned int, hint, tp->rcv_wnd/2);
- tp->ack.rcv_mss = max(unsigned int,
- min(unsigned int,
+ tp->ack.rcv_mss = max_t(unsigned int,
+ min_t(unsigned int,
hint, TCP_MIN_RCVMSS),
TCP_MIN_MSS);
}
@@ -1077,7 +1077,7 @@
*/
static inline __u32 tcp_recalc_ssthresh(struct tcp_opt *tp)
{
- return max(u32, tp->snd_cwnd >> 1, 2);
+ return max_t(u32, tp->snd_cwnd >> 1, 2);
}
/* If cwnd > ssthresh, we may raise ssthresh to be half-way to cwnd.
@@ -1089,7 +1089,7 @@
if ((1<<tp->ca_state)&(TCPF_CA_CWR|TCPF_CA_Recovery))
return tp->snd_ssthresh;
else
- return max(u32, tp->snd_ssthresh,
+ return max_t(u32, tp->snd_ssthresh,
((tp->snd_cwnd >> 1) +
(tp->snd_cwnd >> 2)));
}
@@ -1126,7 +1126,7 @@
{
tp->undo_marker = 0;
tp->snd_ssthresh = tcp_recalc_ssthresh(tp);
- tp->snd_cwnd = min(u32, tp->snd_cwnd,
+ tp->snd_cwnd = min_t(u32, tp->snd_cwnd,
tcp_packets_in_flight(tp) + 1);
tp->snd_cwnd_cnt = 0;
tp->high_seq = tp->snd_nxt;
@@ -1493,7 +1493,7 @@
/* If no clamp set the clamp to the max possible scaled window */
if (*window_clamp == 0)
(*window_clamp) = (65535 << 14);
- space = min(u32, *window_clamp, space);
+ space = min_t(u32, *window_clamp, space);
/* Quantize space offering to a multiple of mss if possible. */
if (space > mss)
@@ -1505,7 +1505,7 @@
* our initial window offering to 32k. There should also
* be a sysctl option to stop being nice.
*/
- (*rcv_wnd) = min(int, space, MAX_TCP_WINDOW);
+ (*rcv_wnd) = min_t(int, space, MAX_TCP_WINDOW);
(*rcv_wscale) = 0;
if (wscale_ok) {
/* See RFC1323 for an explanation of the limit to 14 */
@@ -1514,7 +1514,7 @@
(*rcv_wscale)++;
}
if (*rcv_wscale && sysctl_tcp_app_win && space>=mss &&
- space - max(unsigned int, (space>>sysctl_tcp_app_win), mss>>*rcv_wscale) < 65536/2)
+ space - max_t(unsigned int, (space>>sysctl_tcp_app_win), mss>>*rcv_wscale) < 65536/2)
(*rcv_wscale)--;
}
@@ -1532,7 +1532,7 @@
*rcv_wnd = init_cwnd*mss;
}
/* Set the clamp no higher than max representable value */
- (*window_clamp) = min(u32, 65535 << (*rcv_wscale), *window_clamp);
+ (*window_clamp) = min_t(u32, 65535 << (*rcv_wscale), *window_clamp);
}
static inline int tcp_win_from_space(int space)
@@ -1698,8 +1698,8 @@
static inline void tcp_moderate_sndbuf(struct sock *sk)
{
if (!(sk->userlocks&SOCK_SNDBUF_LOCK)) {
- sk->sndbuf = min(int, sk->sndbuf, sk->wmem_queued/2);
- sk->sndbuf = max(int, sk->sndbuf, SOCK_MIN_SNDBUF);
+ sk->sndbuf = min_t(int, sk->sndbuf, sk->wmem_queued/2);
+ sk->sndbuf = max_t(int, sk->sndbuf, SOCK_MIN_SNDBUF);
}
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)