diff options
author | Eric Dumazet <dada1@cosmosbay.com> | 2007-11-06 02:39:16 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-11-07 07:08:58 -0500 |
commit | 47a31a6ffcca3b55149bccd5b99763e5eea60ac4 (patch) | |
tree | de45b7c03799f16e717b9bf63b249bfe5f0f19a4 /net/ipv4/udp.c | |
parent | 286ab3d46058840d68e5d7d52e316c1f7e98c59f (diff) |
[IPV4]: Use the {DEFINE|REF}_PROTO_INUSE infrastructure
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>
Diffstat (limited to 'net/ipv4/udp.c')
-rw-r--r-- | net/ipv4/udp.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 4bc25b46f33f..03c400ca14c5 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -1430,6 +1430,8 @@ unsigned int udp_poll(struct file *file, struct socket *sock, poll_table *wait) | |||
1430 | 1430 | ||
1431 | } | 1431 | } |
1432 | 1432 | ||
1433 | DEFINE_PROTO_INUSE(udp) | ||
1434 | |||
1433 | struct proto udp_prot = { | 1435 | struct proto udp_prot = { |
1434 | .name = "UDP", | 1436 | .name = "UDP", |
1435 | .owner = THIS_MODULE, | 1437 | .owner = THIS_MODULE, |
@@ -1452,6 +1454,7 @@ struct proto udp_prot = { | |||
1452 | .compat_setsockopt = compat_udp_setsockopt, | 1454 | .compat_setsockopt = compat_udp_setsockopt, |
1453 | .compat_getsockopt = compat_udp_getsockopt, | 1455 | .compat_getsockopt = compat_udp_getsockopt, |
1454 | #endif | 1456 | #endif |
1457 | REF_PROTO_INUSE(udp) | ||
1455 | }; | 1458 | }; |
1456 | 1459 | ||
1457 | /* ------------------------------------------------------------------------ */ | 1460 | /* ------------------------------------------------------------------------ */ |