mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
tcp: rename icsk_timeout() to tcp_timeout_expires()
In preparation of sk->tcp_timeout_timer introduction, rename icsk_timeout() helper and change its argument to plain 'const struct sock *sk'. Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com> Link: https://patch.msgid.link/20251124175013.1473655-2-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
436fa8e7d1
commit
3a6e8fd0bf
@@ -184,10 +184,9 @@ static inline void inet_csk_delack_init(struct sock *sk)
|
||||
memset(&inet_csk(sk)->icsk_ack, 0, sizeof(inet_csk(sk)->icsk_ack));
|
||||
}
|
||||
|
||||
static inline unsigned long
|
||||
icsk_timeout(const struct inet_connection_sock *icsk)
|
||||
static inline unsigned long tcp_timeout_expires(const struct sock *sk)
|
||||
{
|
||||
return READ_ONCE(icsk->icsk_retransmit_timer.expires);
|
||||
return READ_ONCE(inet_csk(sk)->icsk_retransmit_timer.expires);
|
||||
}
|
||||
|
||||
static inline unsigned long
|
||||
|
||||
@@ -287,12 +287,12 @@ int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk,
|
||||
r->idiag_timer = 1;
|
||||
r->idiag_retrans = READ_ONCE(icsk->icsk_retransmits);
|
||||
r->idiag_expires =
|
||||
jiffies_delta_to_msecs(icsk_timeout(icsk) - jiffies);
|
||||
jiffies_delta_to_msecs(tcp_timeout_expires(sk) - jiffies);
|
||||
} else if (icsk_pending == ICSK_TIME_PROBE0) {
|
||||
r->idiag_timer = 4;
|
||||
r->idiag_retrans = READ_ONCE(icsk->icsk_probes_out);
|
||||
r->idiag_expires =
|
||||
jiffies_delta_to_msecs(icsk_timeout(icsk) - jiffies);
|
||||
jiffies_delta_to_msecs(tcp_timeout_expires(sk) - jiffies);
|
||||
} else if (timer_pending(&sk->sk_timer)) {
|
||||
r->idiag_timer = 2;
|
||||
r->idiag_retrans = READ_ONCE(icsk->icsk_probes_out);
|
||||
|
||||
@@ -2869,10 +2869,10 @@ static void get_tcp4_sock(struct sock *sk, struct seq_file *f, int i)
|
||||
icsk_pending == ICSK_TIME_REO_TIMEOUT ||
|
||||
icsk_pending == ICSK_TIME_LOSS_PROBE) {
|
||||
timer_active = 1;
|
||||
timer_expires = icsk_timeout(icsk);
|
||||
timer_expires = tcp_timeout_expires(sk);
|
||||
} else if (icsk_pending == ICSK_TIME_PROBE0) {
|
||||
timer_active = 4;
|
||||
timer_expires = icsk_timeout(icsk);
|
||||
timer_expires = tcp_timeout_expires(sk);
|
||||
} else if (timer_pending(&sk->sk_timer)) {
|
||||
timer_active = 2;
|
||||
timer_expires = sk->sk_timer.expires;
|
||||
|
||||
@@ -510,7 +510,7 @@ static bool tcp_rtx_probe0_timed_out(const struct sock *sk,
|
||||
* and tp->rcv_tstamp might very well have been written recently.
|
||||
* rcv_delta can thus be negative.
|
||||
*/
|
||||
rcv_delta = icsk_timeout(icsk) - tp->rcv_tstamp;
|
||||
rcv_delta = tcp_timeout_expires(sk) - tp->rcv_tstamp;
|
||||
if (rcv_delta <= timeout)
|
||||
return false;
|
||||
|
||||
@@ -697,9 +697,9 @@ void tcp_write_timer_handler(struct sock *sk)
|
||||
!icsk->icsk_pending)
|
||||
return;
|
||||
|
||||
if (time_after(icsk_timeout(icsk), jiffies)) {
|
||||
if (time_after(tcp_timeout_expires(sk), jiffies)) {
|
||||
sk_reset_timer(sk, &icsk->icsk_retransmit_timer,
|
||||
icsk_timeout(icsk));
|
||||
tcp_timeout_expires(sk));
|
||||
return;
|
||||
}
|
||||
tcp_mstamp_refresh(tcp_sk(sk));
|
||||
|
||||
@@ -2163,10 +2163,10 @@ static void get_tcp6_sock(struct seq_file *seq, struct sock *sp, int i)
|
||||
icsk_pending == ICSK_TIME_REO_TIMEOUT ||
|
||||
icsk_pending == ICSK_TIME_LOSS_PROBE) {
|
||||
timer_active = 1;
|
||||
timer_expires = icsk_timeout(icsk);
|
||||
timer_expires = tcp_timeout_expires(sp);
|
||||
} else if (icsk_pending == ICSK_TIME_PROBE0) {
|
||||
timer_active = 4;
|
||||
timer_expires = icsk_timeout(icsk);
|
||||
timer_expires = tcp_timeout_expires(sp);
|
||||
} else if (timer_pending(&sp->sk_timer)) {
|
||||
timer_active = 2;
|
||||
timer_expires = sp->sk_timer.expires;
|
||||
|
||||
@@ -519,7 +519,7 @@ static long mptcp_timeout_from_subflow(const struct mptcp_subflow_context *subfl
|
||||
const struct sock *ssk = mptcp_subflow_tcp_sock(subflow);
|
||||
|
||||
return inet_csk(ssk)->icsk_pending && !subflow->stale_count ?
|
||||
icsk_timeout(inet_csk(ssk)) - jiffies : 0;
|
||||
tcp_timeout_expires(ssk) - jiffies : 0;
|
||||
}
|
||||
|
||||
static void mptcp_set_timeout(struct sock *sk)
|
||||
|
||||
Reference in New Issue
Block a user