netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Amir Noam <amir.noam@intel.com>
To: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com
Subject: [PATCH 7/10] [bonding 2.6] embed stats struct inside bonding private struct
Date: Thu, 4 Sep 2003 20:45:17 +0300	[thread overview]
Message-ID: <200309042045.17273.amir.noam@intel.com> (raw)

diff -Nuarp a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
--- a/drivers/net/bonding/bond_main.c	Thu Sep  4 20:18:08 2003
+++ b/drivers/net/bonding/bond_main.c	Thu Sep  4 20:18:09 2003
@@ -3295,10 +3295,10 @@ static int bond_xmit_activebackup(struct
 static struct net_device_stats *bond_get_stats(struct net_device *dev)
 {
 	bonding_t *bond = dev->priv;
-	struct net_device_stats *stats = bond->stats, *sstats;
+	struct net_device_stats *stats = &(bond->stats), *sstats;
 	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);
 
@@ -3493,9 +3493,7 @@ static int __init bond_init(struct net_d
 	/* initialize rwlocks */
 	rwlock_init(&bond->lock);
 	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->current_slave = NULL;
 	bond->current_arp_slave = NULL;
@@ -3868,8 +3866,7 @@ static int __init bonding_init(void)
 
 		snprintf(name, IFNAMSIZ, "bond%d", no);
 
-		dev = alloc_netdev(sizeof(bonding_t) 
-				   + sizeof(struct net_device_stats),
+		dev = alloc_netdev(sizeof(struct bonding),
 				   name, ether_setup);
 		if (!dev)
 			return -ENOMEM;
diff -Nuarp a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
--- a/drivers/net/bonding/bonding.h	Thu Sep  4 20:18:08 2003
+++ b/drivers/net/bonding/bonding.h	Thu Sep  4 20:18:09 2003
@@ -99,7 +99,7 @@ typedef struct bonding {
 	rwlock_t ptrlock;
 	struct timer_list mii_timer;
 	struct timer_list arp_timer;
-	struct net_device_stats *stats;
+	struct net_device_stats stats;
 #ifdef CONFIG_PROC_FS
 	struct proc_dir_entry *bond_proc_dir;
 	struct proc_dir_entry *bond_proc_info_file;

                 reply	other threads:[~2003-09-04 17:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200309042045.17273.amir.noam@intel.com \
    --to=amir.noam@intel.com \
    --cc=bonding-devel@lists.sourceforge.net \
    --cc=netdev@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).