提交 629ca23c 编写于 作者: P Pavel Emelyanov 提交者: David S. Miller

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: NPavel Emelyanov <xemul@openvz.org>
Acked-by: NDenis V. Lunev <den@openvz.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 4ce2417b
...@@ -158,7 +158,7 @@ DECLARE_SNMP_STAT(struct udp_mib, udplite_stats_in6); ...@@ -158,7 +158,7 @@ DECLARE_SNMP_STAT(struct udp_mib, udplite_stats_in6);
/* /*
* SNMP statistics for UDP and UDP-Lite * 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); \ if (is_udplite) SNMP_INC_STATS_USER(udplite_statistics, field); \
else SNMP_INC_STATS_USER(udp_statistics, field); } while(0) else SNMP_INC_STATS_USER(udp_statistics, field); } while(0)
#define UDP_INC_STATS_BH(field, is_udplite) do { \ #define UDP_INC_STATS_BH(field, is_udplite) do { \
......
...@@ -526,7 +526,8 @@ static int udp_push_pending_frames(struct sock *sk) ...@@ -526,7 +526,8 @@ static int udp_push_pending_frames(struct sock *sk)
up->len = 0; up->len = 0;
up->pending = 0; up->pending = 0;
if (!err) 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; return err;
} }
...@@ -725,7 +726,8 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, ...@@ -725,7 +726,8 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
* seems like overkill. * seems like overkill.
*/ */
if (err == -ENOBUFS || test_bit(SOCK_NOSPACE, &sk->sk_socket->flags)) { 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; return err;
...@@ -888,7 +890,8 @@ int udp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, ...@@ -888,7 +890,8 @@ int udp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
goto out_free; goto out_free;
if (!peeked) 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); sock_recv_timestamp(msg, sk, skb);
...@@ -917,7 +920,7 @@ int udp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, ...@@ -917,7 +920,7 @@ int udp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
csum_copy_err: csum_copy_err:
lock_sock(sk); lock_sock(sk);
if (!skb_kill_datagram(sk, skb, flags)) 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); release_sock(sk);
if (noblock) if (noblock)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册