]> git.baikalelectronics.ru Git - kernel.git/commit
net: Get rid of rtnl_link_stats64 / net_device_stats union
authorBen Hutchings <bhutchings@solarflare.com>
Fri, 9 Jul 2010 09:11:52 +0000 (09:11 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 10 Jul 2010 00:41:56 +0000 (17:41 -0700)
commit9424e370ad56ec949318b9c523169ba3822a5b29
tree53fe969e9f8bb45531c1e84c82e822ff47ea015c
parent95815e404b3ddaa47ae9a230aed9e56627fcfeb3
net: Get rid of rtnl_link_stats64 / net_device_stats union

In commit 4ead13ba75c55620e9d1ea7dbd592fea114ebe1c "net: Enable 64-bit
net device statistics on 32-bit architectures" I redefined struct
net_device_stats so that it could be used in a union with struct
rtnl_link_stats64, avoiding the need for explicit copying or
conversion between the two.  However, this is unsafe because there is
no locking required and no lock consistently held around calls to
dev_get_stats() and use of the statistics structure it returns.

In commit ddb23e6bd52bcc39f0b8cc86c30a09aed966bab5 "net: fix 64 bit
counters on 32 bit arches" Eric Dumazet dealt with that problem by
requiring callers of dev_get_stats() to provide storage for the
result.  This means that the net_device::stats64 field and the padding
in struct net_device_stats are now redundant, so remove them.

Update the comment on net_device_ops::ndo_get_stats64 to reflect its
new usage.

Change dev_txq_stats_fold() to use struct rtnl_link_stats64, since
that is what all its callers are really using and it is no longer
going to be compatible with struct net_device_stats.

Eric Dumazet suggested the separate function for the structure
conversion.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/macvlan.c
include/linux/netdevice.h
net/8021q/vlan_dev.c
net/core/dev.c