aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/af_inet.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@ghostprotocols.net>2005-08-09 22:45:38 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2005-08-29 18:37:29 -0400
commite6848976b721eeb5551cd94673faafeef78d9f35 (patch)
tree6c78b0eb52614ff6386b603ca64091b5aefaa418 /net/ipv4/af_inet.c
parentd13964f4490157b8a290903362bfbc54f750a6bc (diff)
[NET]: Cleanup INET_REFCNT_DEBUG code
Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/af_inet.c')
-rw-r--r--net/ipv4/af_inet.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index 163ae4068b5f..9e83d7773d8f 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -114,10 +114,6 @@
114 114
115DEFINE_SNMP_STAT(struct linux_mib, net_statistics); 115DEFINE_SNMP_STAT(struct linux_mib, net_statistics);
116 116
117#ifdef INET_REFCNT_DEBUG
118atomic_t inet_sock_nr;
119#endif
120
121extern void ip_mc_drop_socket(struct sock *sk); 117extern void ip_mc_drop_socket(struct sock *sk);
122 118
123/* The inetsw table contains everything that inet_create needs to 119/* The inetsw table contains everything that inet_create needs to
@@ -153,11 +149,7 @@ void inet_sock_destruct(struct sock *sk)
153 if (inet->opt) 149 if (inet->opt)
154 kfree(inet->opt); 150 kfree(inet->opt);
155 dst_release(sk->sk_dst_cache); 151 dst_release(sk->sk_dst_cache);
156#ifdef INET_REFCNT_DEBUG 152 sk_refcnt_debug_dec(sk);
157 atomic_dec(&inet_sock_nr);
158 printk(KERN_DEBUG "INET socket %p released, %d are still alive\n",
159 sk, atomic_read(&inet_sock_nr));
160#endif
161} 153}
162 154
163/* 155/*
@@ -317,9 +309,7 @@ static int inet_create(struct socket *sock, int protocol)
317 inet->mc_index = 0; 309 inet->mc_index = 0;
318 inet->mc_list = NULL; 310 inet->mc_list = NULL;
319 311
320#ifdef INET_REFCNT_DEBUG 312 sk_refcnt_debug_inc(sk);
321 atomic_inc(&inet_sock_nr);
322#endif
323 313
324 if (inet->num) { 314 if (inet->num) {
325 /* It assumes that any protocol which allows 315 /* It assumes that any protocol which allows
@@ -1205,7 +1195,3 @@ EXPORT_SYMBOL(inet_stream_ops);
1205EXPORT_SYMBOL(inet_unregister_protosw); 1195EXPORT_SYMBOL(inet_unregister_protosw);
1206EXPORT_SYMBOL(net_statistics); 1196EXPORT_SYMBOL(net_statistics);
1207EXPORT_SYMBOL(sysctl_ip_nonlocal_bind); 1197EXPORT_SYMBOL(sysctl_ip_nonlocal_bind);
1208
1209#ifdef INET_REFCNT_DEBUG
1210EXPORT_SYMBOL(inet_sock_nr);
1211#endif