Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Li Zefan and committed by
Linus Torvalds
46ae220b 06a11920

+1 -4
+1 -4
kernel/cgroup.c
··· 2545 2545 { 2546 2546 int err; 2547 2547 int i; 2548 - struct proc_dir_entry *entry; 2549 2548 2550 2549 err = bdi_init(&cgroup_backing_dev_info); 2551 2550 if (err) ··· 2560 2561 if (err < 0) 2561 2562 goto out; 2562 2563 2563 - entry = create_proc_entry("cgroups", 0, NULL); 2564 - if (entry) 2565 - entry->proc_fops = &proc_cgroupstats_operations; 2564 + proc_create("cgroups", 0, NULL, &proc_cgroupstats_operations); 2566 2565 2567 2566 out: 2568 2567 if (err)