diff options
author | Eric Dumazet <dada1@cosmosbay.com> | 2008-01-03 23:46:48 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:00:36 -0500 |
commit | 65f7651788e18fadb2fbb7276af935d7871e1803 (patch) | |
tree | dcad32d4344d6d11d80061773d9d1dbc9ae92223 /net/ipv6/inet6_hashtables.c | |
parent | 571e7682026fd0e25833d103a3eeb74be29bf199 (diff) |
[NET]: prot_inuse cleanups and optimizations
1) Cleanups (all functions are prefixed by sock_prot_inuse)
sock_prot_inc_use(prot) -> sock_prot_inuse_add(prot,-1)
sock_prot_dec_use(prot) -> sock_prot_inuse_add(prot,-1)
sock_prot_inuse() -> sock_prot_inuse_get()
New functions :
sock_prot_inuse_init() and sock_prot_inuse_free() to abstract pcounter use.
2) if CONFIG_PROC_FS=n, we can zap 'inuse' member from "struct proto",
since nobody wants to read the inuse value.
This saves 1372 bytes on i386/SMP and some cpu cycles.
Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/inet6_hashtables.c')
-rw-r--r-- | net/ipv6/inet6_hashtables.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv6/inet6_hashtables.c b/net/ipv6/inet6_hashtables.c index 0765d8bd380f..a66a7d8e2811 100644 --- a/net/ipv6/inet6_hashtables.c +++ b/net/ipv6/inet6_hashtables.c | |||
@@ -43,7 +43,7 @@ void __inet6_hash(struct inet_hashinfo *hashinfo, | |||
43 | } | 43 | } |
44 | 44 | ||
45 | __sk_add_node(sk, list); | 45 | __sk_add_node(sk, list); |
46 | sock_prot_inc_use(sk->sk_prot); | 46 | sock_prot_inuse_add(sk->sk_prot, 1); |
47 | write_unlock(lock); | 47 | write_unlock(lock); |
48 | } | 48 | } |
49 | EXPORT_SYMBOL(__inet6_hash); | 49 | EXPORT_SYMBOL(__inet6_hash); |
@@ -216,7 +216,7 @@ unique: | |||
216 | BUG_TRAP(sk_unhashed(sk)); | 216 | BUG_TRAP(sk_unhashed(sk)); |
217 | __sk_add_node(sk, &head->chain); | 217 | __sk_add_node(sk, &head->chain); |
218 | sk->sk_hash = hash; | 218 | sk->sk_hash = hash; |
219 | sock_prot_inc_use(sk->sk_prot); | 219 | sock_prot_inuse_add(sk->sk_prot, 1); |
220 | write_unlock(lock); | 220 | write_unlock(lock); |
221 | 221 | ||
222 | if (twp != NULL) { | 222 | if (twp != NULL) { |