All of lore.kernel.org
 help / color / mirror / Atom feed
* [NETLINK] Remove netlink_sock_nr
@ 2004-10-27  5:11 Herbert Xu
  2004-10-27  5:05 ` David S. Miller
  2004-10-27  5:17 ` YOSHIFUJI Hideaki / 吉藤英明
  0 siblings, 2 replies; 4+ messages in thread
From: Herbert Xu @ 2004-10-27  5:11 UTC (permalink / raw)
  To: David S. Miller, netdev

[-- Attachment #1: Type: text/plain, Size: 537 bytes --]

Hi:

This patch removes netlink_sock_nr which is only used by a printk
statement in af_netlink.c.  Even that's only there if
NETLINK_REFCNT_DEBUG is defined.

If we were really looking for netlink refcnt bugs there are probably
better places to do that anyway.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

[-- Attachment #2: p --]
[-- Type: text/plain, Size: 978 bytes --]

===== net/netlink/af_netlink.c 1.57 vs edited =====
--- 1.57/net/netlink/af_netlink.c	2004-10-20 15:10:40 +10:00
+++ edited/net/netlink/af_netlink.c	2004-10-27 15:01:47 +10:00
@@ -80,8 +80,6 @@
 static int netlink_dump(struct sock *sk);
 static void netlink_destroy_callback(struct netlink_callback *cb);
 
-atomic_t netlink_sock_nr;
-
 static rwlock_t nl_table_lock = RW_LOCK_UNLOCKED;
 static atomic_t nl_table_users = ATOMIC_INIT(0);
 
@@ -100,11 +98,6 @@
 	BUG_TRAP(!nlk_sk(sk)->cb);
 
 	kfree(nlk_sk(sk));
-
-	atomic_dec(&netlink_sock_nr);
-#ifdef NETLINK_REFCNT_DEBUG
-	printk(KERN_DEBUG "NETLINK %p released, %d are still alive\n", sk, atomic_read(&netlink_sock_nr));
-#endif
 }
 
 /* This lock without WQ_FLAG_EXCLUSIVE is good on UP and it is _very_ bad on SMP.
@@ -240,7 +233,6 @@
 	spin_lock_init(&nlk->cb_lock);
 	init_waitqueue_head(&nlk->wait);
 	sk->sk_destruct = netlink_sock_destruct;
-	atomic_inc(&netlink_sock_nr);
 
 	sk->sk_protocol = protocol;
 	return 0;

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-10-27  5:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-27  5:11 [NETLINK] Remove netlink_sock_nr Herbert Xu
2004-10-27  5:05 ` David S. Miller
2004-10-27  5:17 ` YOSHIFUJI Hideaki / 吉藤英明
2004-10-27  5:32   ` Herbert Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.