netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-2.6.26 3/5][SOCK]: Drop per-proto inuse init and fre functions (v2).
@ 2008-03-28 12:35 Pavel Emelyanov
  2008-03-28 17:18 ` Eric Dumazet
  0 siblings, 1 reply; 3+ messages in thread
From: Pavel Emelyanov @ 2008-03-28 12:35 UTC (permalink / raw)
  To: David Miller; +Cc: Eric Dumazet, Linux Netdev List

Constructive part of the set is finished here. We have to
remove the pcounter, so start with its init and free
functions.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

---
 include/net/sock.h |   18 ------------------
 net/core/sock.c    |   11 +----------
 2 files changed, 1 insertions(+), 28 deletions(-)

diff --git a/include/net/sock.h b/include/net/sock.h
index ebf9552..1f42942 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -640,31 +640,13 @@ static inline void sk_refcnt_debug_release(const struct sock *sk)
 # define REF_PROTO_INUSE(NAME) PCOUNTER_MEMBER_INITIALIZER(NAME, .inuse)
 /* Called with local bh disabled */
 extern void sock_prot_inuse_add(struct proto *prot, int inc);
-
-static inline int sock_prot_inuse_init(struct proto *proto)
-{
-	return pcounter_alloc(&proto->inuse);
-}
-
 extern int sock_prot_inuse_get(struct proto *proto);
-
-static inline void sock_prot_inuse_free(struct proto *proto)
-{
-	pcounter_free(&proto->inuse);
-}
 #else
 # define DEFINE_PROTO_INUSE(NAME)
 # define REF_PROTO_INUSE(NAME)
 static void inline sock_prot_inuse_add(struct proto *prot, int inc)
 {
 }
-static int inline sock_prot_inuse_init(struct proto *proto)
-{
-	return 0;
-}
-static void inline sock_prot_inuse_free(struct proto *proto)
-{
-}
 #endif
 
 
diff --git a/net/core/sock.c b/net/core/sock.c
index 174c64b..c1ae56e 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -1999,11 +1999,6 @@ int proto_register(struct proto *prot, int alloc_slab)
 	char *request_sock_slab_name = NULL;
 	char *timewait_sock_slab_name;
 
-	if (sock_prot_inuse_init(prot) != 0) {
-		printk(KERN_CRIT "%s: Can't alloc inuse counters!\n", prot->name);
-		goto out;
-	}
-
 	if (alloc_slab) {
 		prot->slab = kmem_cache_create(prot->name, prot->obj_size, 0,
 					       SLAB_HWCACHE_ALIGN, NULL);
@@ -2011,7 +2006,7 @@ int proto_register(struct proto *prot, int alloc_slab)
 		if (prot->slab == NULL) {
 			printk(KERN_CRIT "%s: Can't create sock SLAB cache!\n",
 			       prot->name);
-			goto out_free_inuse;
+			goto out;
 		}
 
 		if (prot->rsk_prot != NULL) {
@@ -2070,8 +2065,6 @@ out_free_request_sock_slab_name:
 out_free_sock_slab:
 	kmem_cache_destroy(prot->slab);
 	prot->slab = NULL;
-out_free_inuse:
-	sock_prot_inuse_free(prot);
 out:
 	return -ENOBUFS;
 }
@@ -2085,8 +2078,6 @@ void proto_unregister(struct proto *prot)
 	list_del(&prot->node);
 	write_unlock(&proto_list_lock);
 
-	sock_prot_inuse_free(prot);
-
 	if (prot->slab != NULL) {
 		kmem_cache_destroy(prot->slab);
 		prot->slab = NULL;
-- 
1.5.3.4



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

* Re: [PATCH net-2.6.26 3/5][SOCK]: Drop per-proto inuse init and fre functions (v2).
  2008-03-28 12:35 [PATCH net-2.6.26 3/5][SOCK]: Drop per-proto inuse init and fre functions (v2) Pavel Emelyanov
@ 2008-03-28 17:18 ` Eric Dumazet
  2008-03-28 23:40   ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Dumazet @ 2008-03-28 17:18 UTC (permalink / raw)
  To: Pavel Emelyanov; +Cc: David Miller, Linux Netdev List

Pavel Emelyanov a écrit :
> Constructive part of the set is finished here. We have to
> remove the pcounter, so start with its init and free
> functions.
>
> Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
>
>   
Acked-by: Eric Dumazet <dada1@cosmosbay.com>
> ---
>  include/net/sock.h |   18 ------------------
>  net/core/sock.c    |   11 +----------
>  2 files changed, 1 insertions(+), 28 deletions(-)
>
> diff --git a/include/net/sock.h b/include/net/sock.h
> index ebf9552..1f42942 100644
> --- a/include/net/sock.h
> +++ b/include/net/sock.h
> @@ -640,31 +640,13 @@ static inline void sk_refcnt_debug_release(const struct sock *sk)
>  # define REF_PROTO_INUSE(NAME) PCOUNTER_MEMBER_INITIALIZER(NAME, .inuse)
>  /* Called with local bh disabled */
>  extern void sock_prot_inuse_add(struct proto *prot, int inc);
> -
> -static inline int sock_prot_inuse_init(struct proto *proto)
> -{
> -	return pcounter_alloc(&proto->inuse);
> -}
> -
>  extern int sock_prot_inuse_get(struct proto *proto);
> -
> -static inline void sock_prot_inuse_free(struct proto *proto)
> -{
> -	pcounter_free(&proto->inuse);
> -}
>  #else
>  # define DEFINE_PROTO_INUSE(NAME)
>  # define REF_PROTO_INUSE(NAME)
>  static void inline sock_prot_inuse_add(struct proto *prot, int inc)
>  {
>  }
> -static int inline sock_prot_inuse_init(struct proto *proto)
> -{
> -	return 0;
> -}
> -static void inline sock_prot_inuse_free(struct proto *proto)
> -{
> -}
>  #endif
>  
>  
> diff --git a/net/core/sock.c b/net/core/sock.c
> index 174c64b..c1ae56e 100644
> --- a/net/core/sock.c
> +++ b/net/core/sock.c
> @@ -1999,11 +1999,6 @@ int proto_register(struct proto *prot, int alloc_slab)
>  	char *request_sock_slab_name = NULL;
>  	char *timewait_sock_slab_name;
>  
> -	if (sock_prot_inuse_init(prot) != 0) {
> -		printk(KERN_CRIT "%s: Can't alloc inuse counters!\n", prot->name);
> -		goto out;
> -	}
> -
>  	if (alloc_slab) {
>  		prot->slab = kmem_cache_create(prot->name, prot->obj_size, 0,
>  					       SLAB_HWCACHE_ALIGN, NULL);
> @@ -2011,7 +2006,7 @@ int proto_register(struct proto *prot, int alloc_slab)
>  		if (prot->slab == NULL) {
>  			printk(KERN_CRIT "%s: Can't create sock SLAB cache!\n",
>  			       prot->name);
> -			goto out_free_inuse;
> +			goto out;
>  		}
>  
>  		if (prot->rsk_prot != NULL) {
> @@ -2070,8 +2065,6 @@ out_free_request_sock_slab_name:
>  out_free_sock_slab:
>  	kmem_cache_destroy(prot->slab);
>  	prot->slab = NULL;
> -out_free_inuse:
> -	sock_prot_inuse_free(prot);
>  out:
>  	return -ENOBUFS;
>  }
> @@ -2085,8 +2078,6 @@ void proto_unregister(struct proto *prot)
>  	list_del(&prot->node);
>  	write_unlock(&proto_list_lock);
>  
> -	sock_prot_inuse_free(prot);
> -
>  	if (prot->slab != NULL) {
>  		kmem_cache_destroy(prot->slab);
>  		prot->slab = NULL;
>   





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

* Re: [PATCH net-2.6.26 3/5][SOCK]: Drop per-proto inuse init and fre functions (v2).
  2008-03-28 17:18 ` Eric Dumazet
@ 2008-03-28 23:40   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2008-03-28 23:40 UTC (permalink / raw)
  To: dada1; +Cc: xemul, netdev

From: Eric Dumazet <dada1@cosmosbay.com>
Date: Fri, 28 Mar 2008 18:18:47 +0100

> Pavel Emelyanov a écrit :
> > Constructive part of the set is finished here. We have to
> > remove the pcounter, so start with its init and free
> > functions.
> >
> > Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
> >
> >   
> Acked-by: Eric Dumazet <dada1@cosmosbay.com>

Applied.

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

end of thread, other threads:[~2008-03-28 23:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-28 12:35 [PATCH net-2.6.26 3/5][SOCK]: Drop per-proto inuse init and fre functions (v2) Pavel Emelyanov
2008-03-28 17:18 ` Eric Dumazet
2008-03-28 23:40   ` 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).