]> git.neil.brown.name Git - history.git/commitdiff
[NET]: Move dev_base and dev_base_lock into net/core/dev.c
authorStephen Hemminger <shemminger@osdl.org>
Fri, 6 Feb 2004 05:35:14 +0000 (21:35 -0800)
committerStephen Hemminger <shemminger@osdl.org>
Fri, 6 Feb 2004 05:35:14 +0000 (21:35 -0800)
drivers/net/Space.c
net/core/dev.c

index 51ed68f486b8146d9a12cbb0e595674cfb76a456..4da8f077de9aae1570f3c8917ed14cb45f4a1c97 100644 (file)
@@ -430,28 +430,3 @@ static int __init net_olddevs_init(void)
 }
 
 device_initcall(net_olddevs_init);
-
-/*
- * The @dev_base list is protected by @dev_base_lock and the rtln
- * semaphore.
- *
- * Pure readers hold dev_base_lock for reading.
- *
- * Writers must hold the rtnl semaphore while they loop through the
- * dev_base list, and hold dev_base_lock for writing when they do the
- * actual updates.  This allows pure readers to access the list even
- * while a writer is preparing to update it.
- *
- * To put it another way, dev_base_lock is held for writing only to
- * protect against pure readers; the rtnl semaphore provides the
- * protection against other writers.
- *
- * See, for example usages, register_netdevice() and
- * unregister_netdevice(), which must be called with the rtnl
- * semaphore held.
- */
-struct net_device *dev_base;
-rwlock_t dev_base_lock = RW_LOCK_UNLOCKED;
-
-EXPORT_SYMBOL(dev_base);
-EXPORT_SYMBOL(dev_base_lock);
index 55fbdfa556c185f69fbe9ddb24d6bcec5fc183c9..e298f2b7f9c99b9c04d3f46bc50e2d5cb92a168a 100644 (file)
@@ -160,6 +160,31 @@ static void sample_queue(unsigned long dummy);
 static struct timer_list samp_timer = TIMER_INITIALIZER(sample_queue, 0, 0);
 #endif
 
+/*
+ * The @dev_base list is protected by @dev_base_lock and the rtln
+ * semaphore.
+ *
+ * Pure readers hold dev_base_lock for reading.
+ *
+ * Writers must hold the rtnl semaphore while they loop through the
+ * dev_base list, and hold dev_base_lock for writing when they do the
+ * actual updates.  This allows pure readers to access the list even
+ * while a writer is preparing to update it.
+ *
+ * To put it another way, dev_base_lock is held for writing only to
+ * protect against pure readers; the rtnl semaphore provides the
+ * protection against other writers.
+ *
+ * See, for example usages, register_netdevice() and
+ * unregister_netdevice(), which must be called with the rtnl
+ * semaphore held.
+ */
+struct net_device *dev_base;
+rwlock_t dev_base_lock = RW_LOCK_UNLOCKED;
+
+EXPORT_SYMBOL(dev_base);
+EXPORT_SYMBOL(dev_base_lock);
+
 /*
  *     Our notifier list
  */