[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>
Showing
- include/net/inet_hashtables.h 1 addition, 1 deletioninclude/net/inet_hashtables.h
- include/net/sock.h 30 additions, 10 deletionsinclude/net/sock.h
- include/net/udp.h 1 addition, 1 deletioninclude/net/udp.h
- net/core/sock.c 3 additions, 3 deletionsnet/core/sock.c
- net/ipv4/inet_hashtables.c 3 additions, 3 deletionsnet/ipv4/inet_hashtables.c
- net/ipv4/inet_timewait_sock.c 1 addition, 1 deletionnet/ipv4/inet_timewait_sock.c
- net/ipv4/proc.c 5 additions, 4 deletionsnet/ipv4/proc.c
- net/ipv4/raw.c 2 additions, 2 deletionsnet/ipv4/raw.c
- net/ipv4/udp.c 1 addition, 1 deletionnet/ipv4/udp.c
- net/ipv6/inet6_hashtables.c 2 additions, 2 deletionsnet/ipv6/inet6_hashtables.c
- net/ipv6/ipv6_sockglue.c 4 additions, 4 deletionsnet/ipv6/ipv6_sockglue.c
- net/ipv6/proc.c 4 additions, 4 deletionsnet/ipv6/proc.c
Loading
Please register or sign in to comment