summaryrefslogtreecommitdiff
path: root/net/netrom/nr_timer.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@conectiva.com.br>2003-06-04 16:00:32 -0300
committerArnaldo Carvalho de Melo <acme@conectiva.com.br>2003-06-04 16:00:32 -0300
commit63413da5d31d99ba8d89cf9d9ff997f93b49443d (patch)
tree4add196b24e554f140663a7bd92260a7fd9ebdc4 /net/netrom/nr_timer.c
parentfbf47415732b00ff5578d55c6be779a109a01e1f (diff)
o net: create struct sock_common and use in struct sock & tcp_tw_bucket
With this the data dependency is reduced to just making sure that the first member of both struct sock and struct tcp_tw_bucket are a struct sock_common. Also makes it easier to grep for struct sock and struct tcp_tw_bucket usage in the tree as all the members in those structs are prefixed, respectively, with sk_ and tw_, like struct inode (i_), struct block_device (bd_), etc. Checked namespace with make tags/ctags, just one colision with the macros for the struct sock members, with a wanrouter struct, fixed that s/sk_state/state_sk/g in the wanrouter struct. Checked as well if the names of the members in both structs collided with some macro, none found.
Diffstat (limited to 'net/netrom/nr_timer.c')
-rw-r--r--net/netrom/nr_timer.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/net/netrom/nr_timer.c b/net/netrom/nr_timer.c
index 6c29f5bdc258..2b9271567068 100644
--- a/net/netrom/nr_timer.c
+++ b/net/netrom/nr_timer.c
@@ -92,13 +92,13 @@ void nr_start_idletimer(struct sock *sk)
void nr_start_heartbeat(struct sock *sk)
{
- del_timer(&sk->timer);
+ del_timer(&sk->sk_timer);
- sk->timer.data = (unsigned long)sk;
- sk->timer.function = &nr_heartbeat_expiry;
- sk->timer.expires = jiffies + 5 * HZ;
+ sk->sk_timer.data = (unsigned long)sk;
+ sk->sk_timer.function = &nr_heartbeat_expiry;
+ sk->sk_timer.expires = jiffies + 5 * HZ;
- add_timer(&sk->timer);
+ add_timer(&sk->sk_timer);
}
void nr_stop_t1timer(struct sock *sk)
@@ -123,7 +123,7 @@ void nr_stop_idletimer(struct sock *sk)
void nr_stop_heartbeat(struct sock *sk)
{
- del_timer(&sk->timer);
+ del_timer(&sk->sk_timer);
}
int nr_t1timer_running(struct sock *sk)
@@ -142,7 +142,7 @@ static void nr_heartbeat_expiry(unsigned long param)
/* Magic here: If we listen() and a new link dies before it
is accepted() it isn't 'dead' so doesn't get removed. */
if (sock_flag(sk, SOCK_DESTROY) ||
- (sk->state == TCP_LISTEN && sock_flag(sk, SOCK_DEAD))) {
+ (sk->sk_state == TCP_LISTEN && sock_flag(sk, SOCK_DEAD))) {
nr_destroy_socket(sk);
return;
}
@@ -152,7 +152,7 @@ static void nr_heartbeat_expiry(unsigned long param)
/*
* Check for the state of the receive buffer.
*/
- if (atomic_read(&sk->rmem_alloc) < (sk->rcvbuf / 2) &&
+ if (atomic_read(&sk->sk_rmem_alloc) < (sk->sk_rcvbuf / 2) &&
(nr->condition & NR_COND_OWN_RX_BUSY)) {
nr->condition &= ~NR_COND_OWN_RX_BUSY;
nr->condition &= ~NR_COND_ACK_PENDING;
@@ -206,12 +206,12 @@ static void nr_idletimer_expiry(unsigned long param)
nr_stop_t2timer(sk);
nr_stop_t4timer(sk);
- sk->state = TCP_CLOSE;
- sk->err = 0;
- sk->shutdown |= SEND_SHUTDOWN;
+ sk->sk_state = TCP_CLOSE;
+ sk->sk_err = 0;
+ sk->sk_shutdown |= SEND_SHUTDOWN;
if (!sock_flag(sk, SOCK_DEAD)) {
- sk->state_change(sk);
+ sk->sk_state_change(sk);
sock_set_flag(sk, SOCK_DEAD);
}
bh_unlock_sock(sk);