aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/inet_timewait_sock.c
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2007-12-20 18:32:54 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 17:59:28 -0500
commit7054fb9376e111d0edc06efcedbac6930a6caf76 (patch)
treea008ba9a3f844c5480dc650f4d0fa3fbd0690dab /net/ipv4/inet_timewait_sock.c
parent77a5ba55dab7b4ece12f37c717022819e3f77b44 (diff)
[INET]: Uninline the inet_twsk_put function.
This one is not that big, but is widely used: saves 1200 bytes from net/ipv4/built-in.o add/remove: 1/0 grow/shrink: 1/12 up/down: 97/-1300 (-1203) function old new delta inet_twsk_put - 87 +87 __inet_lookup_listener 274 284 +10 tcp_sacktag_write_queue 2255 2254 -1 tcp_time_wait 482 411 -71 __inet_check_established 796 722 -74 tcp_v4_err 973 898 -75 __inet_twsk_kill 230 154 -76 inet_twsk_deschedule 180 103 -77 tcp_v4_do_rcv 462 384 -78 inet_hash_connect 686 607 -79 inet_twdr_do_twkill_work 236 150 -86 inet_twdr_twcal_tick 395 307 -88 tcp_v4_rcv 1744 1480 -264 tcp_timewait_state_process 975 644 -331 Export it for ipv6 module. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/inet_timewait_sock.c')
-rw-r--r--net/ipv4/inet_timewait_sock.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/net/ipv4/inet_timewait_sock.c b/net/ipv4/inet_timewait_sock.c
index d43e787031a4..1b7db4208969 100644
--- a/net/ipv4/inet_timewait_sock.c
+++ b/net/ipv4/inet_timewait_sock.c
@@ -48,6 +48,21 @@ static void __inet_twsk_kill(struct inet_timewait_sock *tw,
48 inet_twsk_put(tw); 48 inet_twsk_put(tw);
49} 49}
50 50
51void inet_twsk_put(struct inet_timewait_sock *tw)
52{
53 if (atomic_dec_and_test(&tw->tw_refcnt)) {
54 struct module *owner = tw->tw_prot->owner;
55 twsk_destructor((struct sock *)tw);
56#ifdef SOCK_REFCNT_DEBUG
57 printk(KERN_DEBUG "%s timewait_sock %p released\n",
58 tw->tw_prot->name, tw);
59#endif
60 kmem_cache_free(tw->tw_prot->twsk_prot->twsk_slab, tw);
61 module_put(owner);
62 }
63}
64EXPORT_SYMBOL_GPL(inet_twsk_put);
65
51/* 66/*
52 * Enter the time wait state. This is called with locally disabled BH. 67 * Enter the time wait state. This is called with locally disabled BH.
53 * Essentially we whip up a timewait bucket, copy the relevant info into it 68 * Essentially we whip up a timewait bucket, copy the relevant info into it