From cc1b2ba84162afbb7b11d230a1062bfba12adc24 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Thu, 5 Feb 2004 21:35:14 -0800 Subject: [PATCH] [NET]: Move dev_base and dev_base_lock into net/core/dev.c --- drivers/net/Space.c | 25 ------------------------- net/core/dev.c | 25 +++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/drivers/net/Space.c b/drivers/net/Space.c index 51ed68f486b81..4da8f077de9aa 100644 --- a/drivers/net/Space.c +++ b/drivers/net/Space.c @@ -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); diff --git a/net/core/dev.c b/net/core/dev.c index 55fbdfa556c18..e298f2b7f9c99 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -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 */ -- 2.53.0