Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
cc1b2ba8
Commit
cc1b2ba8
authored
Feb 05, 2004
by
Stephen Hemminger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[NET]: Move dev_base and dev_base_lock into net/core/dev.c
parent
33be9435
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
25 deletions
+25
-25
drivers/net/Space.c
drivers/net/Space.c
+0
-25
net/core/dev.c
net/core/dev.c
+25
-0
No files found.
drivers/net/Space.c
View file @
cc1b2ba8
...
...
@@ -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
);
net/core/dev.c
View file @
cc1b2ba8
...
...
@@ -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
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment