]> err.no Git - linux-2.6/commitdiff
MIB: add struct net to UDP_INC_STATS_USER
authorPavel Emelyanov <xemul@openvz.org>
Sun, 6 Jul 2008 04:18:07 +0000 (21:18 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 6 Jul 2008 04:18:07 +0000 (21:18 -0700)
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>
include/net/udp.h
net/ipv4/udp.c

index 7a8684855245b0ad755737965183055e8e2d5f52..13319094b1345dea04dd92fd7809c08becf92ed1 100644 (file)
@@ -158,7 +158,7 @@ DECLARE_SNMP_STAT(struct udp_mib, udplite_stats_in6);
 /*
  *     SNMP statistics for UDP and UDP-Lite
  */
-#define UDP_INC_STATS_USER(field, is_udplite)                         do {   \
+#define UDP_INC_STATS_USER(net, field, is_udplite)           do { (void)net; \
        if (is_udplite) SNMP_INC_STATS_USER(udplite_statistics, field);       \
        else            SNMP_INC_STATS_USER(udp_statistics, field);  }  while(0)
 #define UDP_INC_STATS_BH(field, is_udplite)                           do  {  \
index 3bbf6fb6e4f51f1cd43d7956964827a9afd169f7..c97da5394d70065f0df2b22a4e38243762bde760 100644 (file)
@@ -526,7 +526,8 @@ out:
        up->len = 0;
        up->pending = 0;
        if (!err)
-               UDP_INC_STATS_USER(UDP_MIB_OUTDATAGRAMS, is_udplite);
+               UDP_INC_STATS_USER(sock_net(sk),
+                               UDP_MIB_OUTDATAGRAMS, is_udplite);
        return err;
 }
 
@@ -725,7 +726,8 @@ out:
         * seems like overkill.
         */
        if (err == -ENOBUFS || test_bit(SOCK_NOSPACE, &sk->sk_socket->flags)) {
-               UDP_INC_STATS_USER(UDP_MIB_SNDBUFERRORS, is_udplite);
+               UDP_INC_STATS_USER(sock_net(sk),
+                               UDP_MIB_SNDBUFERRORS, is_udplite);
        }
        return err;
 
@@ -888,7 +890,8 @@ try_again:
                goto out_free;
 
        if (!peeked)
-               UDP_INC_STATS_USER(UDP_MIB_INDATAGRAMS, is_udplite);
+               UDP_INC_STATS_USER(sock_net(sk),
+                               UDP_MIB_INDATAGRAMS, is_udplite);
 
        sock_recv_timestamp(msg, sk, skb);
 
@@ -917,7 +920,7 @@ out:
 csum_copy_err:
        lock_sock(sk);
        if (!skb_kill_datagram(sk, skb, flags))
-               UDP_INC_STATS_USER(UDP_MIB_INERRORS, is_udplite);
+               UDP_INC_STATS_USER(sock_net(sk), UDP_MIB_INERRORS, is_udplite);
        release_sock(sk);
 
        if (noblock)