提交 46ae220b 编写于 作者: L Li Zefan 提交者: Linus Torvalds

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: NLi Zefan <lizf@cn.fujitsu.com>
Acked-by: NPaul Menage <menage@google.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 06a11920
...@@ -2545,7 +2545,6 @@ int __init cgroup_init(void) ...@@ -2545,7 +2545,6 @@ int __init cgroup_init(void)
{ {
int err; int err;
int i; int i;
struct proc_dir_entry *entry;
err = bdi_init(&cgroup_backing_dev_info); err = bdi_init(&cgroup_backing_dev_info);
if (err) if (err)
...@@ -2561,9 +2560,7 @@ int __init cgroup_init(void) ...@@ -2561,9 +2560,7 @@ int __init cgroup_init(void)
if (err < 0) if (err < 0)
goto out; goto out;
entry = create_proc_entry("cgroups", 0, NULL); proc_create("cgroups", 0, NULL, &proc_cgroupstats_operations);
if (entry)
entry->proc_fops = &proc_cgroupstats_operations;
out: out:
if (err) if (err)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册