]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[IPV4]: Use the {DEFINE|REF}_PROTO_INUSE infrastructure
authorEric Dumazet <dada1@cosmosbay.com>
Tue, 6 Nov 2007 07:39:16 +0000 (23:39 -0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Wed, 7 Nov 2007 12:08:58 +0000 (04:08 -0800)
Trivial patch to make "tcp,udp,udplite,raw" protocols uses the fast
"inuse sockets" infrastructure

Each protocol use then a static percpu var, instead of a dynamic one.
This saves some ram and some cpu cycles

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/raw.c
net/ipv4/tcp_ipv4.c
net/ipv4/udp.c
net/ipv4/udplite.c

index 3916faca3afef64fcbc8d583715b384f364c56d7..66b42f547bf9c0b21bd2462a4534e54978b2813f 100644 (file)
@@ -760,6 +760,8 @@ static int raw_ioctl(struct sock *sk, int cmd, unsigned long arg)
        }
 }
 
+DEFINE_PROTO_INUSE(raw)
+
 struct proto raw_prot = {
        .name              = "RAW",
        .owner             = THIS_MODULE,
@@ -781,6 +783,7 @@ struct proto raw_prot = {
        .compat_setsockopt = compat_raw_setsockopt,
        .compat_getsockopt = compat_raw_getsockopt,
 #endif
+       REF_PROTO_INUSE(raw)
 };
 
 #ifdef CONFIG_PROC_FS
index d438dfb0c8f38a9f53833a6283eb30a40741ff78..e9127cdced20a0c774b780eca0a1d32a7f41fdc0 100644 (file)
@@ -2417,6 +2417,8 @@ void tcp4_proc_exit(void)
 }
 #endif /* CONFIG_PROC_FS */
 
+DEFINE_PROTO_INUSE(tcp)
+
 struct proto tcp_prot = {
        .name                   = "TCP",
        .owner                  = THIS_MODULE,
@@ -2451,6 +2453,7 @@ struct proto tcp_prot = {
        .compat_setsockopt      = compat_tcp_setsockopt,
        .compat_getsockopt      = compat_tcp_getsockopt,
 #endif
+       REF_PROTO_INUSE(tcp)
 };
 
 void __init tcp_v4_init(struct net_proto_family *ops)
index 4bc25b46f33ff9138512e5da915d01007048e9d0..03c400ca14c5af07db1ab22686d95621b5cc8813 100644 (file)
@@ -1430,6 +1430,8 @@ unsigned int udp_poll(struct file *file, struct socket *sock, poll_table *wait)
 
 }
 
+DEFINE_PROTO_INUSE(udp)
+
 struct proto udp_prot = {
        .name              = "UDP",
        .owner             = THIS_MODULE,
@@ -1452,6 +1454,7 @@ struct proto udp_prot = {
        .compat_setsockopt = compat_udp_setsockopt,
        .compat_getsockopt = compat_udp_getsockopt,
 #endif
+       REF_PROTO_INUSE(udp)
 };
 
 /* ------------------------------------------------------------------------ */
index 94977205abb47581686bfd46bc1f5232100f005a..f5baeb3e8b85d368e075cd57ca7cd8c48b68702b 100644 (file)
@@ -44,6 +44,8 @@ static        struct net_protocol udplite_protocol = {
        .no_policy      = 1,
 };
 
+DEFINE_PROTO_INUSE(udplite)
+
 struct proto   udplite_prot = {
        .name              = "UDP-Lite",
        .owner             = THIS_MODULE,
@@ -67,6 +69,7 @@ struct proto  udplite_prot = {
        .compat_setsockopt = compat_udp_setsockopt,
        .compat_getsockopt = compat_udp_getsockopt,
 #endif
+       REF_PROTO_INUSE(udplite)
 };
 
 static struct inet_protosw udplite4_protosw = {