aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/cgroup.c
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2008-04-29 04:00:08 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-29 11:06:09 -0400
commit46ae220bea40bd1cf4abec2d5cdfb4f9396c7115 (patch)
treee485a13dd8d85d2f40ecf73d9482671dc39ceab1 /kernel/cgroup.c
parent06a119204d3e1e67d393e996ed987b0df7998381 (diff)
cgroup: switch to proc_create()
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>
Diffstat (limited to 'kernel/cgroup.c')
-rw-r--r--kernel/cgroup.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 97ab04c3fcf5..436e26f4d624 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -2545,7 +2545,6 @@ int __init cgroup_init(void)
2545{ 2545{
2546 int err; 2546 int err;
2547 int i; 2547 int i;
2548 struct proc_dir_entry *entry;
2549 2548
2550 err = bdi_init(&cgroup_backing_dev_info); 2549 err = bdi_init(&cgroup_backing_dev_info);
2551 if (err) 2550 if (err)
@@ -2561,9 +2560,7 @@ int __init cgroup_init(void)
2561 if (err < 0) 2560 if (err < 0)
2562 goto out; 2561 goto out;
2563 2562
2564 entry = create_proc_entry("cgroups", 0, NULL); 2563 proc_create("cgroups", 0, NULL, &proc_cgroupstats_operations);
2565 if (entry)
2566 entry->proc_fops = &proc_cgroupstats_operations;
2567 2564
2568out: 2565out:
2569 if (err) 2566 if (err)