seq_file: use proc_create() in documentation
authorAlexey Dobriyan <[email protected]>
Wed, 16 Dec 2009 00:47:00 +0000 (16:47 -0800)
committerLinus Torvalds <[email protected]>
Wed, 16 Dec 2009 15:20:07 +0000 (07:20 -0800)
Using create_proc_entry() + ->proc_fops assignment is racy because
->proc_fops will be NULL for some time, use proc_create() to avoid race.

Signed-off-by: Alexey Dobriyan <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Jonathan Corbet <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Documentation/filesystems/seq_file.txt

index 0d15ebccf5b037a6590ee8ab9c616172d28cdf82..a1e2e0dda9074d1d8a3102df3488a8a5f29cfb17 100644 (file)
@@ -248,9 +248,7 @@ code, that is done in the initialization code in the usual way:
        {
                struct proc_dir_entry *entry;
 
-               entry = create_proc_entry("sequence", 0, NULL);
-               if (entry)
-                       entry->proc_fops = &ct_file_ops;
+               proc_create("sequence", 0, NULL, &ct_file_ops);
                return 0;
        }