drivers: use non-racy method for proc entries creation (2)

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 <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Alexey Dobriyan <[email protected]>
Cc: "Eric W. Biederman" <[email protected]>
Cc: Peter Osterlund <[email protected]>
Cc: Bartlomiej Zolnierkiewicz <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Neil Brown <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Bjorn Helgaas <[email protected]>
Cc: Alessandro Zummo <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
Denis V. Lunev 2008-04-29 01:02:35 -07:00 • committed by Linus Torvalds
commit c7705f3449
12 changed files with 33 additions and 68 deletions

View file

@ -5947,13 +5947,9 @@ static struct notifier_block md_notifier = {
static void md_geninit(void)
{
struct proc_dir_entry *p;
dprintk("md: sizeof(mdp_super_t) = %d\n", (int)sizeof(mdp_super_t));
p = create_proc_entry("mdstat", S_IRUGO, NULL);
if (p)
p->proc_fops = &md_seq_fops;
proc_create("mdstat", S_IRUGO, NULL, &md_seq_fops);
}
static int __init md_init(void)