diff options
| author | Arnaldo Carvalho de Melo <acme@conectiva.com.br> | 2003-05-27 23:09:54 -0300 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@conectiva.com.br> | 2003-05-27 23:09:54 -0300 |
| commit | 4ea1f8303bcd69d068ff235e24840acd99afe6c6 (patch) | |
| tree | bf89e69588c4665941ab9e333d153bbddf97c81f /net/ax25/ax25_std_timer.c | |
| parent | 015498d534572f8a9c3bf5f1dfc02bd02bfb2c9d (diff) | |
o net: abstract access to struct sock ->flags
This makes:
1. simpler primitive to access struct sock flags, shorter
2. we check if the flag is valid by using enum sock_flags
3. we can change the implementation to an open coded bit operations
if it proves to be faster than the more general bit manipulation
routines now used, i.e. we only have to change sock.h, not the
whole net tree like now
Diffstat (limited to 'net/ax25/ax25_std_timer.c')
| -rw-r--r-- | net/ax25/ax25_std_timer.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/net/ax25/ax25_std_timer.c b/net/ax25/ax25_std_timer.c index 604b4fe3ee4a..8f82c2169fb7 100644 --- a/net/ax25/ax25_std_timer.c +++ b/net/ax25/ax25_std_timer.c @@ -37,7 +37,9 @@ void ax25_std_heartbeat_expiry(ax25_cb *ax25) case AX25_STATE_0: /* Magic here: If we listen() and a new link dies before it is accepted() it isn't 'dead' so doesn't get removed. */ - if (ax25->sk == NULL || test_bit(SOCK_DESTROY, &ax25->sk->flags) || (ax25->sk->state == TCP_LISTEN && test_bit(SOCK_DEAD, &ax25->sk->flags))) { + if (!ax25->sk || sock_flag(ax25->sk, SOCK_DESTROY) || + (ax25->sk->state == TCP_LISTEN && + sock_flag(ax25->sk, SOCK_DEAD))) { ax25_destroy_socket(ax25); return; } @@ -94,9 +96,10 @@ void ax25_std_idletimer_expiry(ax25_cb *ax25) ax25->sk->state = TCP_CLOSE; ax25->sk->err = 0; ax25->sk->shutdown |= SEND_SHUTDOWN; - if (!test_bit(SOCK_DEAD, &ax25->sk->flags)) + if (!sock_flag(ax25->sk, SOCK_DEAD)) { ax25->sk->state_change(ax25->sk); - __set_bit(SOCK_DEAD, &ax25->sk->flags); + sock_set_flag(ax25->sk, SOCK_DEAD); + } } } |
