Commit 367c8f00 authored by Amir Noam's avatar Amir Noam Committed by Stephen Hemminger

[bonding 2.6] embed stats struct inside bonding private struct

parent 45c72c85
...@@ -3295,10 +3295,10 @@ static int bond_xmit_activebackup(struct sk_buff *skb, struct net_device *dev) ...@@ -3295,10 +3295,10 @@ static int bond_xmit_activebackup(struct sk_buff *skb, struct net_device *dev)
static struct net_device_stats *bond_get_stats(struct net_device *dev) static struct net_device_stats *bond_get_stats(struct net_device *dev)
{ {
bonding_t *bond = dev->priv; bonding_t *bond = dev->priv;
struct net_device_stats *stats = bond->stats, *sstats; struct net_device_stats *stats = &(bond->stats), *sstats;
slave_t *slave; slave_t *slave;
memset(bond->stats, 0, sizeof(struct net_device_stats)); memset(stats, 0, sizeof(struct net_device_stats));
read_lock_bh(&bond->lock); read_lock_bh(&bond->lock);
...@@ -3493,9 +3493,7 @@ static int __init bond_init(struct net_device *dev) ...@@ -3493,9 +3493,7 @@ static int __init bond_init(struct net_device *dev)
/* initialize rwlocks */ /* initialize rwlocks */
rwlock_init(&bond->lock); rwlock_init(&bond->lock);
rwlock_init(&bond->ptrlock); rwlock_init(&bond->ptrlock);
/* space is reserved for stats in alloc_netdev call. */
bond->stats = (struct net_device_stats *)(bond + 1);
bond->next = bond->prev = (slave_t *)bond; bond->next = bond->prev = (slave_t *)bond;
bond->current_slave = NULL; bond->current_slave = NULL;
bond->current_arp_slave = NULL; bond->current_arp_slave = NULL;
...@@ -3868,8 +3866,7 @@ static int __init bonding_init(void) ...@@ -3868,8 +3866,7 @@ static int __init bonding_init(void)
snprintf(name, IFNAMSIZ, "bond%d", no); snprintf(name, IFNAMSIZ, "bond%d", no);
dev = alloc_netdev(sizeof(bonding_t) dev = alloc_netdev(sizeof(struct bonding),
+ sizeof(struct net_device_stats),
name, ether_setup); name, ether_setup);
if (!dev) if (!dev)
return -ENOMEM; return -ENOMEM;
......
...@@ -99,7 +99,7 @@ typedef struct bonding { ...@@ -99,7 +99,7 @@ typedef struct bonding {
rwlock_t ptrlock; rwlock_t ptrlock;
struct timer_list mii_timer; struct timer_list mii_timer;
struct timer_list arp_timer; struct timer_list arp_timer;
struct net_device_stats *stats; struct net_device_stats stats;
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
struct proc_dir_entry *bond_proc_dir; struct proc_dir_entry *bond_proc_dir;
struct proc_dir_entry *bond_proc_info_file; struct proc_dir_entry *bond_proc_info_file;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment