[NET]: prot_inuse cleanups and optimizations
authorEric Dumazet <dada1@cosmosbay.com>
Fri, 4 Jan 2008 04:46:48 +0000 (20:46 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 23:00:36 +0000 (15:00 -0800)
commit65f7651788e18fadb2fbb7276af935d7871e1803
treedcad32d4344d6d11d80061773d9d1dbc9ae92223
parent571e7682026fd0e25833d103a3eeb74be29bf199
[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>
12 files changed:
include/net/inet_hashtables.h
include/net/sock.h
include/net/udp.h
net/core/sock.c
net/ipv4/inet_hashtables.c
net/ipv4/inet_timewait_sock.c
net/ipv4/proc.c
net/ipv4/raw.c
net/ipv4/udp.c
net/ipv6/inet6_hashtables.c
net/ipv6/ipv6_sockglue.c
net/ipv6/proc.c