Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
b608d6a2
Commit
b608d6a2
authored
Jun 08, 2004
by
David S. Miller
Browse files
Options
Browse Files
Download
Plain Diff
Merge nuts.davemloft.net:/disk1/BK/network-2.6
into nuts.davemloft.net:/disk1/BK/net-2.6
parents
3c3daf31
f03795c5
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
40 additions
and
44 deletions
+40
-44
include/net/sock.h
include/net/sock.h
+5
-0
include/net/tcp.h
include/net/tcp.h
+4
-10
net/bluetooth/l2cap.c
net/bluetooth/l2cap.c
+2
-6
net/bluetooth/sco.c
net/bluetooth/sco.c
+2
-6
net/core/sock.c
net/core/sock.c
+17
-0
net/ipv4/tcp_output.c
net/ipv4/tcp_output.c
+1
-2
net/ipv4/tcp_timer.c
net/ipv4/tcp_timer.c
+9
-20
No files found.
include/net/sock.h
View file @
b608d6a2
...
...
@@ -898,6 +898,11 @@ static inline void skb_set_owner_r(struct sk_buff *skb, struct sock *sk)
atomic_add
(
skb
->
truesize
,
&
sk
->
sk_rmem_alloc
);
}
extern
void
sk_reset_timer
(
struct
sock
*
sk
,
struct
timer_list
*
timer
,
unsigned
long
expires
);
extern
void
sk_stop_timer
(
struct
sock
*
sk
,
struct
timer_list
*
timer
);
static
inline
int
sock_queue_rcv_skb
(
struct
sock
*
sk
,
struct
sk_buff
*
skb
)
{
int
err
=
0
;
...
...
include/net/tcp.h
View file @
b608d6a2
...
...
@@ -989,9 +989,7 @@ static inline void tcp_clear_xmit_timer(struct sock *sk, int what)
tp
->
pending
=
0
;
#ifdef TCP_CLEAR_TIMERS
if
(
timer_pending
(
&
tp
->
retransmit_timer
)
&&
del_timer
(
&
tp
->
retransmit_timer
))
__sock_put
(
sk
);
sk_stop_timer
(
sk
,
&
tp
->
retransmit_timer
);
#endif
break
;
case
TCP_TIME_DACK
:
...
...
@@ -999,9 +997,7 @@ static inline void tcp_clear_xmit_timer(struct sock *sk, int what)
tp
->
ack
.
pending
=
0
;
#ifdef TCP_CLEAR_TIMERS
if
(
timer_pending
(
&
tp
->
delack_timer
)
&&
del_timer
(
&
tp
->
delack_timer
))
__sock_put
(
sk
);
sk_stop_timer
(
sk
,
&
tp
->
delack_timer
);
#endif
break
;
default:
...
...
@@ -1030,15 +1026,13 @@ static inline void tcp_reset_xmit_timer(struct sock *sk, int what, unsigned long
case
TCP_TIME_PROBE0
:
tp
->
pending
=
what
;
tp
->
timeout
=
jiffies
+
when
;
if
(
!
mod_timer
(
&
tp
->
retransmit_timer
,
tp
->
timeout
))
sock_hold
(
sk
);
sk_reset_timer
(
sk
,
&
tp
->
retransmit_timer
,
tp
->
timeout
);
break
;
case
TCP_TIME_DACK
:
tp
->
ack
.
pending
|=
TCP_ACK_TIMER
;
tp
->
ack
.
timeout
=
jiffies
+
when
;
if
(
!
mod_timer
(
&
tp
->
delack_timer
,
tp
->
ack
.
timeout
))
sock_hold
(
sk
);
sk_reset_timer
(
sk
,
&
tp
->
delack_timer
,
tp
->
ack
.
timeout
);
break
;
default:
...
...
net/bluetooth/l2cap.c
View file @
b608d6a2
...
...
@@ -95,17 +95,13 @@ static void l2cap_sock_timeout(unsigned long arg)
static
void
l2cap_sock_set_timer
(
struct
sock
*
sk
,
long
timeout
)
{
BT_DBG
(
"sk %p state %d timeout %ld"
,
sk
,
sk
->
sk_state
,
timeout
);
if
(
!
mod_timer
(
&
sk
->
sk_timer
,
jiffies
+
timeout
))
sock_hold
(
sk
);
sk_reset_timer
(
sk
,
&
sk
->
sk_timer
,
jiffies
+
timeout
);
}
static
void
l2cap_sock_clear_timer
(
struct
sock
*
sk
)
{
BT_DBG
(
"sock %p state %d"
,
sk
,
sk
->
sk_state
);
if
(
timer_pending
(
&
sk
->
sk_timer
)
&&
del_timer
(
&
sk
->
sk_timer
))
__sock_put
(
sk
);
sk_stop_timer
(
sk
,
&
sk
->
sk_timer
);
}
static
void
l2cap_sock_init_timer
(
struct
sock
*
sk
)
...
...
net/bluetooth/sco.c
View file @
b608d6a2
...
...
@@ -91,17 +91,13 @@ static void sco_sock_timeout(unsigned long arg)
static
void
sco_sock_set_timer
(
struct
sock
*
sk
,
long
timeout
)
{
BT_DBG
(
"sock %p state %d timeout %ld"
,
sk
,
sk
->
sk_state
,
timeout
);
if
(
!
mod_timer
(
&
sk
->
sk_timer
,
jiffies
+
timeout
))
sock_hold
(
sk
);
sk_reset_timer
(
sk
,
&
sk
->
sk_timer
,
jiffies
+
timeout
);
}
static
void
sco_sock_clear_timer
(
struct
sock
*
sk
)
{
BT_DBG
(
"sock %p state %d"
,
sk
,
sk
->
sk_state
);
if
(
timer_pending
(
&
sk
->
sk_timer
)
&&
del_timer
(
&
sk
->
sk_timer
))
__sock_put
(
sk
);
sk_stop_timer
(
sk
,
&
sk
->
sk_timer
);
}
static
void
sco_sock_init_timer
(
struct
sock
*
sk
)
...
...
net/core/sock.c
View file @
b608d6a2
...
...
@@ -1099,6 +1099,23 @@ void sk_send_sigurg(struct sock *sk)
sk_wake_async
(
sk
,
3
,
POLL_PRI
);
}
void
sk_reset_timer
(
struct
sock
*
sk
,
struct
timer_list
*
timer
,
unsigned
long
expires
)
{
if
(
!
mod_timer
(
timer
,
expires
))
sock_hold
(
sk
);
}
EXPORT_SYMBOL
(
sk_reset_timer
);
void
sk_stop_timer
(
struct
sock
*
sk
,
struct
timer_list
*
timer
)
{
if
(
timer_pending
(
timer
)
&&
del_timer
(
timer
))
__sock_put
(
sk
);
}
EXPORT_SYMBOL
(
sk_stop_timer
);
void
sock_init_data
(
struct
socket
*
sock
,
struct
sock
*
sk
)
{
skb_queue_head_init
(
&
sk
->
sk_receive_queue
);
...
...
net/ipv4/tcp_output.c
View file @
b608d6a2
...
...
@@ -1389,8 +1389,7 @@ void tcp_send_delayed_ack(struct sock *sk)
}
tp
->
ack
.
pending
|=
TCP_ACK_SCHED
|
TCP_ACK_TIMER
;
tp
->
ack
.
timeout
=
timeout
;
if
(
!
mod_timer
(
&
tp
->
delack_timer
,
timeout
))
sock_hold
(
sk
);
sk_reset_timer
(
sk
,
&
tp
->
delack_timer
,
timeout
);
}
/* This routine sends an ack and also updates the window. */
...
...
net/ipv4/tcp_timer.c
View file @
b608d6a2
...
...
@@ -68,18 +68,13 @@ void tcp_clear_xmit_timers(struct sock *sk)
struct
tcp_opt
*
tp
=
tcp_sk
(
sk
);
tp
->
pending
=
0
;
if
(
timer_pending
(
&
tp
->
retransmit_timer
)
&&
del_timer
(
&
tp
->
retransmit_timer
))
__sock_put
(
sk
);
sk_stop_timer
(
sk
,
&
tp
->
retransmit_timer
);
tp
->
ack
.
pending
=
0
;
tp
->
ack
.
blocked
=
0
;
if
(
timer_pending
(
&
tp
->
delack_timer
)
&&
del_timer
(
&
tp
->
delack_timer
))
__sock_put
(
sk
);
sk_stop_timer
(
sk
,
&
tp
->
delack_timer
);
if
(
timer_pending
(
&
sk
->
sk_timer
)
&&
del_timer
(
&
sk
->
sk_timer
))
__sock_put
(
sk
);
sk_stop_timer
(
sk
,
&
sk
->
sk_timer
);
}
static
void
tcp_write_err
(
struct
sock
*
sk
)
...
...
@@ -218,8 +213,7 @@ static void tcp_delack_timer(unsigned long data)
/* Try again later. */
tp
->
ack
.
blocked
=
1
;
NET_INC_STATS_BH
(
DelayedACKLocked
);
if
(
!
mod_timer
(
&
tp
->
delack_timer
,
jiffies
+
TCP_DELACK_MIN
))
sock_hold
(
sk
);
sk_reset_timer
(
sk
,
&
tp
->
delack_timer
,
jiffies
+
TCP_DELACK_MIN
);
goto
out_unlock
;
}
...
...
@@ -229,8 +223,7 @@ static void tcp_delack_timer(unsigned long data)
goto
out
;
if
(
time_after
(
tp
->
ack
.
timeout
,
jiffies
))
{
if
(
!
mod_timer
(
&
tp
->
delack_timer
,
tp
->
ack
.
timeout
))
sock_hold
(
sk
);
sk_reset_timer
(
sk
,
&
tp
->
delack_timer
,
tp
->
ack
.
timeout
);
goto
out
;
}
tp
->
ack
.
pending
&=
~
TCP_ACK_TIMER
;
...
...
@@ -429,8 +422,7 @@ static void tcp_write_timer(unsigned long data)
bh_lock_sock
(
sk
);
if
(
sock_owned_by_user
(
sk
))
{
/* Try again later */
if
(
!
mod_timer
(
&
tp
->
retransmit_timer
,
jiffies
+
(
HZ
/
20
)))
sock_hold
(
sk
);
sk_reset_timer
(
sk
,
&
tp
->
retransmit_timer
,
jiffies
+
(
HZ
/
20
));
goto
out_unlock
;
}
...
...
@@ -438,8 +430,7 @@ static void tcp_write_timer(unsigned long data)
goto
out
;
if
(
time_after
(
tp
->
timeout
,
jiffies
))
{
if
(
!
mod_timer
(
&
tp
->
retransmit_timer
,
tp
->
timeout
))
sock_hold
(
sk
);
sk_reset_timer
(
sk
,
&
tp
->
retransmit_timer
,
tp
->
timeout
);
goto
out
;
}
...
...
@@ -557,14 +548,12 @@ static void tcp_synack_timer(struct sock *sk)
void
tcp_delete_keepalive_timer
(
struct
sock
*
sk
)
{
if
(
timer_pending
(
&
sk
->
sk_timer
)
&&
del_timer
(
&
sk
->
sk_timer
))
__sock_put
(
sk
);
sk_stop_timer
(
sk
,
&
sk
->
sk_timer
);
}
void
tcp_reset_keepalive_timer
(
struct
sock
*
sk
,
unsigned
long
len
)
{
if
(
!
mod_timer
(
&
sk
->
sk_timer
,
jiffies
+
len
))
sock_hold
(
sk
);
sk_reset_timer
(
sk
,
&
sk
->
sk_timer
,
jiffies
+
len
);
}
void
tcp_set_keepalive
(
struct
sock
*
sk
,
int
val
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment