diff options
author | Arnaldo Carvalho de Melo <acme@ghostprotocols.net> | 2005-08-09 23:08:09 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2005-08-29 18:41:49 -0400 |
commit | f3f05f7046e7c85b04af390d95a82a27160dd5d0 (patch) | |
tree | 9a4a552c030ea8b2428ceee75311d73a6b339255 /include/net/tcp.h | |
parent | 6e04e02165a7209a71db553b7bc48d68421e5ebf (diff) |
[INET]: Generalise the tcp_listen_ lock routines
Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/tcp.h')
-rw-r--r-- | include/net/tcp.h | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h index 99e47695d4b6..bc110cc7022b 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -1447,27 +1447,6 @@ static __inline__ void tcp_openreq_init(struct request_sock *req, | |||
1447 | 1447 | ||
1448 | extern void tcp_enter_memory_pressure(void); | 1448 | extern void tcp_enter_memory_pressure(void); |
1449 | 1449 | ||
1450 | extern void tcp_listen_wlock(void); | ||
1451 | |||
1452 | /* - We may sleep inside this lock. | ||
1453 | * - If sleeping is not required (or called from BH), | ||
1454 | * use plain read_(un)lock(&inet_hashinfo.lhash_lock). | ||
1455 | */ | ||
1456 | |||
1457 | static inline void tcp_listen_lock(void) | ||
1458 | { | ||
1459 | /* read_lock synchronizes to candidates to writers */ | ||
1460 | read_lock(&tcp_hashinfo.lhash_lock); | ||
1461 | atomic_inc(&tcp_hashinfo.lhash_users); | ||
1462 | read_unlock(&tcp_hashinfo.lhash_lock); | ||
1463 | } | ||
1464 | |||
1465 | static inline void tcp_listen_unlock(void) | ||
1466 | { | ||
1467 | if (atomic_dec_and_test(&tcp_hashinfo.lhash_users)) | ||
1468 | wake_up(&tcp_hashinfo.lhash_wait); | ||
1469 | } | ||
1470 | |||
1471 | static inline int keepalive_intvl_when(const struct tcp_sock *tp) | 1450 | static inline int keepalive_intvl_when(const struct tcp_sock *tp) |
1472 | { | 1451 | { |
1473 | return tp->keepalive_intvl ? : sysctl_tcp_keepalive_intvl; | 1452 | return tp->keepalive_intvl ? : sysctl_tcp_keepalive_intvl; |