diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2008-07-06 00:18:07 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-07-06 00:18:07 -0400 |
commit | 629ca23c331ec75ac87b016debbb3c4d2fe62650 (patch) | |
tree | 491b70f7b51ac43cd706564f741366f9f05ccf13 | |
parent | 4ce2417bfb3c7b1c5ed449782f4d86bafd7f1b69 (diff) |
MIB: add struct net to UDP_INC_STATS_USER
Nothing special - all the places already have a struct sock
at hands, so use the sock_net() net.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/net/udp.h | 2 | ||||
-rw-r--r-- | net/ipv4/udp.c | 11 |
2 files changed, 8 insertions, 5 deletions
diff --git a/include/net/udp.h b/include/net/udp.h index 7a8684855245..13319094b134 100644 --- a/include/net/udp.h +++ b/include/net/udp.h | |||
@@ -158,7 +158,7 @@ DECLARE_SNMP_STAT(struct udp_mib, udplite_stats_in6); | |||
158 | /* | 158 | /* |
159 | * SNMP statistics for UDP and UDP-Lite | 159 | * SNMP statistics for UDP and UDP-Lite |
160 | */ | 160 | */ |
161 | #define UDP_INC_STATS_USER(field, is_udplite) do { \ | 161 | #define UDP_INC_STATS_USER(net, field, is_udplite) do { (void)net; \ |
162 | if (is_udplite) SNMP_INC_STATS_USER(udplite_statistics, field); \ | 162 | if (is_udplite) SNMP_INC_STATS_USER(udplite_statistics, field); \ |
163 | else SNMP_INC_STATS_USER(udp_statistics, field); } while(0) | 163 | else SNMP_INC_STATS_USER(udp_statistics, field); } while(0) |
164 | #define UDP_INC_STATS_BH(field, is_udplite) do { \ | 164 | #define UDP_INC_STATS_BH(field, is_udplite) do { \ |
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 3bbf6fb6e4f5..c97da5394d70 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -526,7 +526,8 @@ out: | |||
526 | up->len = 0; | 526 | up->len = 0; |
527 | up->pending = 0; | 527 | up->pending = 0; |
528 | if (!err) | 528 | if (!err) |
529 | UDP_INC_STATS_USER(UDP_MIB_OUTDATAGRAMS, is_udplite); | 529 | UDP_INC_STATS_USER(sock_net(sk), |
530 | UDP_MIB_OUTDATAGRAMS, is_udplite); | ||
530 | return err; | 531 | return err; |
531 | } | 532 | } |
532 | 533 | ||
@@ -725,7 +726,8 @@ out: | |||
725 | * seems like overkill. | 726 | * seems like overkill. |
726 | */ | 727 | */ |
727 | if (err == -ENOBUFS || test_bit(SOCK_NOSPACE, &sk->sk_socket->flags)) { | 728 | if (err == -ENOBUFS || test_bit(SOCK_NOSPACE, &sk->sk_socket->flags)) { |
728 | UDP_INC_STATS_USER(UDP_MIB_SNDBUFERRORS, is_udplite); | 729 | UDP_INC_STATS_USER(sock_net(sk), |
730 | UDP_MIB_SNDBUFERRORS, is_udplite); | ||
729 | } | 731 | } |
730 | return err; | 732 | return err; |
731 | 733 | ||
@@ -888,7 +890,8 @@ try_again: | |||
888 | goto out_free; | 890 | goto out_free; |
889 | 891 | ||
890 | if (!peeked) | 892 | if (!peeked) |
891 | UDP_INC_STATS_USER(UDP_MIB_INDATAGRAMS, is_udplite); | 893 | UDP_INC_STATS_USER(sock_net(sk), |
894 | UDP_MIB_INDATAGRAMS, is_udplite); | ||
892 | 895 | ||
893 | sock_recv_timestamp(msg, sk, skb); | 896 | sock_recv_timestamp(msg, sk, skb); |
894 | 897 | ||
@@ -917,7 +920,7 @@ out: | |||
917 | csum_copy_err: | 920 | csum_copy_err: |
918 | lock_sock(sk); | 921 | lock_sock(sk); |
919 | if (!skb_kill_datagram(sk, skb, flags)) | 922 | if (!skb_kill_datagram(sk, skb, flags)) |
920 | UDP_INC_STATS_USER(UDP_MIB_INERRORS, is_udplite); | 923 | UDP_INC_STATS_USER(sock_net(sk), UDP_MIB_INERRORS, is_udplite); |
921 | release_sock(sk); | 924 | release_sock(sk); |
922 | 925 | ||
923 | if (noblock) | 926 | if (noblock) |