diff options
author | Tom Herbert <therbert@google.com> | 2010-10-07 10:09:10 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-10-08 14:34:32 -0700 |
commit | 4315d834c1496ddca977e9e22002b77c85bfec2c (patch) | |
tree | b5d36552a72ac630e7024d855e564e63db93bb6a /net/core/net-sysfs.c | |
parent | a131d82266e77b8eb8a2dab930a94ed0de9e91b0 (diff) | |
download | linux-stable-4315d834c1496ddca977e9e22002b77c85bfec2c.tar.gz linux-stable-4315d834c1496ddca977e9e22002b77c85bfec2c.tar.bz2 linux-stable-4315d834c1496ddca977e9e22002b77c85bfec2c.zip |
net: Fix rxq ref counting
The rx->count reference is used to track reference counts to the
number of rx-queue kobjects created for the device. This patch
eliminates initialization of the counter in netif_alloc_rx_queues
and instead increments the counter each time a kobject is created.
This is now symmetric with the decrement that is done when an object is
released.
Signed-off-by: Tom Herbert <therbert@google.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/net-sysfs.c')
-rw-r--r-- | net/core/net-sysfs.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index fa81fd0a488f..b143173e3eb2 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c @@ -726,6 +726,7 @@ static struct kobj_type rx_queue_ktype = { static int rx_queue_add_kobject(struct net_device *net, int index) { struct netdev_rx_queue *queue = net->_rx + index; + struct netdev_rx_queue *first = queue->first; struct kobject *kobj = &queue->kobj; int error = 0; @@ -738,6 +739,7 @@ static int rx_queue_add_kobject(struct net_device *net, int index) } kobject_uevent(kobj, KOBJ_ADD); + atomic_inc(&first->count); return error; } |