Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 46ae220b authored by Li Zefan's avatar Li Zefan Committed by Linus Torvalds
Browse files

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: default avatarLi Zefan <lizf@cn.fujitsu.com>
Acked-by: default avatarPaul Menage <menage@google.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 06a11920
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -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)