netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] No need to inc/dec packet_socks_nr if PACKET_REFCNT_DEBUG is not set
@ 2007-11-08 10:37 Denis V. Lunev
  2007-11-08 10:51 ` Denis V. Lunev
  0 siblings, 1 reply; 2+ messages in thread
From: Denis V. Lunev @ 2007-11-08 10:37 UTC (permalink / raw)
  To: davem; +Cc: devel, containers, netdev

No need to inc/dec packet_socks_nr if PACKET_REFCNT_DEBUG is not set.

Signed-off-by: Denis V. Lunev <den@openvz.org>

--- ./net/packet/af_packet.c.packetrefcnt	2007-11-08 13:48:22.000000000 +0300
+++ ./net/packet/af_packet.c	2007-11-08 13:54:29.000000000 +0300
@@ -135,7 +135,9 @@ dev->hard_header == NULL (ll header is a
    packet classifier depends on it.
  */
 
+#ifdef PACKET_REFCNT_DEBUG
 static atomic_t packet_socks_nr;
+#endif
 
 
 /* Private packet socket structures. */
@@ -232,8 +234,8 @@ static void packet_sock_destruct(struct 
 		return;
 	}
 
-	atomic_dec(&packet_socks_nr);
 #ifdef PACKET_REFCNT_DEBUG
+	atomic_dec(&packet_socks_nr);
 	printk(KERN_DEBUG "PACKET socket %p is free, %d are alive\n", sk, atomic_read(&packet_socks_nr));
 #endif
 }
@@ -1005,7 +1007,9 @@ static int packet_create(struct net *net
 	po->num = proto;
 
 	sk->sk_destruct = packet_sock_destruct;
+#ifdef PACKET_REFCNT_DEBUG
 	atomic_inc(&packet_socks_nr);
+#endif
 
 	/*
 	 *	Attach a protocol block

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

* Re: [PATCH] No need to inc/dec packet_socks_nr if PACKET_REFCNT_DEBUG is not set
  2007-11-08 10:37 [PATCH] No need to inc/dec packet_socks_nr if PACKET_REFCNT_DEBUG is not set Denis V. Lunev
@ 2007-11-08 10:51 ` Denis V. Lunev
  0 siblings, 0 replies; 2+ messages in thread
From: Denis V. Lunev @ 2007-11-08 10:51 UTC (permalink / raw)
  To: Denis V. Lunev; +Cc: davem, devel, containers, netdev

pls disregard this, Pavel have sent one similar already

Denis V. Lunev wrote:
> No need to inc/dec packet_socks_nr if PACKET_REFCNT_DEBUG is not set.
> 
> Signed-off-by: Denis V. Lunev <den@openvz.org>
> 
> --- ./net/packet/af_packet.c.packetrefcnt	2007-11-08 13:48:22.000000000 +0300
> +++ ./net/packet/af_packet.c	2007-11-08 13:54:29.000000000 +0300
> @@ -135,7 +135,9 @@ dev->hard_header == NULL (ll header is a
>     packet classifier depends on it.
>   */
>  
> +#ifdef PACKET_REFCNT_DEBUG
>  static atomic_t packet_socks_nr;
> +#endif
>  
>  
>  /* Private packet socket structures. */
> @@ -232,8 +234,8 @@ static void packet_sock_destruct(struct 
>  		return;
>  	}
>  
> -	atomic_dec(&packet_socks_nr);
>  #ifdef PACKET_REFCNT_DEBUG
> +	atomic_dec(&packet_socks_nr);
>  	printk(KERN_DEBUG "PACKET socket %p is free, %d are alive\n", sk, atomic_read(&packet_socks_nr));
>  #endif
>  }
> @@ -1005,7 +1007,9 @@ static int packet_create(struct net *net
>  	po->num = proto;
>  
>  	sk->sk_destruct = packet_sock_destruct;
> +#ifdef PACKET_REFCNT_DEBUG
>  	atomic_inc(&packet_socks_nr);
> +#endif
>  
>  	/*
>  	 *	Attach a protocol block
> -
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


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

end of thread, other threads:[~2007-11-08 10:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-08 10:37 [PATCH] No need to inc/dec packet_socks_nr if PACKET_REFCNT_DEBUG is not set Denis V. Lunev
2007-11-08 10:51 ` Denis V. Lunev

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).