]> err.no Git - linux-2.6/commitdiff
cgroup: switch to proc_create()
authorLi Zefan <lizf@cn.fujitsu.com>
Tue, 29 Apr 2008 08:00:08 +0000 (01:00 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 29 Apr 2008 15:06:09 +0000 (08:06 -0700)
There is a race between create_proc_entry() and the assignment of file ops.
proc_create() is invented to fix it.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Paul Menage <menage@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/cgroup.c

index 97ab04c3fcf561bdeb072d8bbd4993f7c7caecd9..436e26f4d62425bc7b9896046efe53bdab7abe26 100644 (file)
@@ -2545,7 +2545,6 @@ int __init cgroup_init(void)
 {
        int err;
        int i;
-       struct proc_dir_entry *entry;
 
        err = bdi_init(&cgroup_backing_dev_info);
        if (err)
@@ -2561,9 +2560,7 @@ int __init cgroup_init(void)
        if (err < 0)
                goto out;
 
-       entry = create_proc_entry("cgroups", 0, NULL);
-       if (entry)
-               entry->proc_fops = &proc_cgroupstats_operations;
+       proc_create("cgroups", 0, NULL, &proc_cgroupstats_operations);
 
 out:
        if (err)