diff options
author | Denis V. Lunev <den@openvz.org> | 2008-04-29 04:02:29 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-29 11:06:22 -0400 |
commit | a95609cb0283a23e519e607ff9fc2a4aa77e2532 (patch) | |
tree | 053d411aa27dafead6326a70d0ca3482bd2d0494 /drivers/net/bonding | |
parent | cf7acfab032ff262f42954328cdfd20a5d9aaaac (diff) |
netdev: use non-racy method for proc entries creation
Use proc_create()/proc_create_data() to make sure that ->proc_fops and ->data
be setup before gluing PDE to main tree.
Signed-off-by: Denis V. Lunev <den@openvz.org>
Cc: Jeff Garzik <jgarzik@pobox.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r-- | drivers/net/bonding/bond_main.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 6e91b4b7aabb..6425603bc379 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -3282,17 +3282,14 @@ static int bond_create_proc_entry(struct bonding *bond) | |||
3282 | struct net_device *bond_dev = bond->dev; | 3282 | struct net_device *bond_dev = bond->dev; |
3283 | 3283 | ||
3284 | if (bond_proc_dir) { | 3284 | if (bond_proc_dir) { |
3285 | bond->proc_entry = create_proc_entry(bond_dev->name, | 3285 | bond->proc_entry = proc_create_data(bond_dev->name, |
3286 | S_IRUGO, | 3286 | S_IRUGO, bond_proc_dir, |
3287 | bond_proc_dir); | 3287 | &bond_info_fops, bond); |
3288 | if (bond->proc_entry == NULL) { | 3288 | if (bond->proc_entry == NULL) { |
3289 | printk(KERN_WARNING DRV_NAME | 3289 | printk(KERN_WARNING DRV_NAME |
3290 | ": Warning: Cannot create /proc/net/%s/%s\n", | 3290 | ": Warning: Cannot create /proc/net/%s/%s\n", |
3291 | DRV_NAME, bond_dev->name); | 3291 | DRV_NAME, bond_dev->name); |
3292 | } else { | 3292 | } else { |
3293 | bond->proc_entry->data = bond; | ||
3294 | bond->proc_entry->proc_fops = &bond_info_fops; | ||
3295 | bond->proc_entry->owner = THIS_MODULE; | ||
3296 | memcpy(bond->proc_file_name, bond_dev->name, IFNAMSIZ); | 3293 | memcpy(bond->proc_file_name, bond_dev->name, IFNAMSIZ); |
3297 | } | 3294 | } |
3298 | } | 3295 | } |