* [PATCH][IPX] Use existing sock refcnt debugging infrastructure
@ 2007-11-09 13:42 Pavel Emelyanov
2007-11-09 14:39 ` Arnaldo Carvalho de Melo
0 siblings, 1 reply; 3+ messages in thread
From: Pavel Emelyanov @ 2007-11-09 13:42 UTC (permalink / raw)
To: David Miller; +Cc: Arnaldo Carvalho de Melo, Linux Netdev List, devel
Just like in the af_packet.c, the ipx_sock_nr variable is used
for debugging purposes.
Switch to using existing infrastructure. Thanks to Arnaldo for
pointing this out.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
---
diff --git a/net/ipx/af_ipx.c b/net/ipx/af_ipx.c
index a195a66..c76a952 100644
--- a/net/ipx/af_ipx.c
+++ b/net/ipx/af_ipx.c
@@ -92,11 +92,6 @@ extern int ipxrtr_route_skb(struct sk_buff *skb);
extern struct ipx_route *ipxrtr_lookup(__be32 net);
extern int ipxrtr_ioctl(unsigned int cmd, void __user *arg);
-#undef IPX_REFCNT_DEBUG
-#ifdef IPX_REFCNT_DEBUG
-atomic_t ipx_sock_nr;
-#endif
-
struct ipx_interface *ipx_interfaces_head(void)
{
struct ipx_interface *rc = NULL;
@@ -151,14 +146,7 @@ static void ipx_destroy_socket(struct sock *sk)
{
ipx_remove_socket(sk);
skb_queue_purge(&sk->sk_receive_queue);
-#ifdef IPX_REFCNT_DEBUG
- atomic_dec(&ipx_sock_nr);
- printk(KERN_DEBUG "IPX socket %p released, %d are still alive\n", sk,
- atomic_read(&ipx_sock_nr));
- if (atomic_read(&sk->sk_refcnt) != 1)
- printk(KERN_DEBUG "Destruction sock ipx %p delayed, cnt=%d\n",
- sk, atomic_read(&sk->sk_refcnt));
-#endif
+ sk_refcnt_debug_dec(sk);
sock_put(sk);
}
@@ -1384,11 +1372,8 @@ static int ipx_create(struct net *net, struct socket *sock, int protocol)
sk = sk_alloc(net, PF_IPX, GFP_KERNEL, &ipx_proto);
if (!sk)
goto out;
-#ifdef IPX_REFCNT_DEBUG
- atomic_inc(&ipx_sock_nr);
- printk(KERN_DEBUG "IPX socket %p created, now we have %d alive\n", sk,
- atomic_read(&ipx_sock_nr));
-#endif
+
+ sk_refcnt_debug_inc(sk);
sock_init_data(sock, sk);
sk->sk_no_check = 1; /* Checksum off by default */
sock->ops = &ipx_dgram_ops;
@@ -1409,6 +1394,7 @@ static int ipx_release(struct socket *sock)
sock_set_flag(sk, SOCK_DEAD);
sock->sk = NULL;
+ sk_refcnt_debug_release(sk);
ipx_destroy_socket(sk);
out:
return 0;
--
1.5.3.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH][IPX] Use existing sock refcnt debugging infrastructure
2007-11-09 13:42 [PATCH][IPX] Use existing sock refcnt debugging infrastructure Pavel Emelyanov
@ 2007-11-09 14:39 ` Arnaldo Carvalho de Melo
2007-11-11 5:39 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2007-11-09 14:39 UTC (permalink / raw)
To: Pavel Emelyanov
Cc: David Miller, Arnaldo Carvalho de Melo, Linux Netdev List, devel
Em Fri, Nov 09, 2007 at 04:42:05PM +0300, Pavel Emelyanov escreveu:
> Just like in the af_packet.c, the ipx_sock_nr variable is used
> for debugging purposes.
>
> Switch to using existing infrastructure. Thanks to Arnaldo for
> pointing this out.
>
> Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH][IPX] Use existing sock refcnt debugging infrastructure
2007-11-09 14:39 ` Arnaldo Carvalho de Melo
@ 2007-11-11 5:39 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2007-11-11 5:39 UTC (permalink / raw)
To: acme; +Cc: xemul, netdev, devel
From: "Arnaldo Carvalho de Melo" <acme@redhat.com>
Date: Fri, 9 Nov 2007 12:39:08 -0200
> Em Fri, Nov 09, 2007 at 04:42:05PM +0300, Pavel Emelyanov escreveu:
> > Just like in the af_packet.c, the ipx_sock_nr variable is used
> > for debugging purposes.
> >
> > Switch to using existing infrastructure. Thanks to Arnaldo for
> > pointing this out.
> >
> > Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
>
> Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Also applied, thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-11-11 5:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-09 13:42 [PATCH][IPX] Use existing sock refcnt debugging infrastructure Pavel Emelyanov
2007-11-09 14:39 ` Arnaldo Carvalho de Melo
2007-11-11 5:39 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).