Skip to content

Commit 46ae220

Browse files
Li Zefantorvalds
authored andcommitted
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>
1 parent 06a1192 commit 46ae220

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

‎kernel/cgroup.c‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2545,7 +2545,6 @@ int __init cgroup_init(void)
25452545
{
25462546
int err;
25472547
int i;
2548-
struct proc_dir_entry *entry;
25492548

25502549
err = bdi_init(&cgroup_backing_dev_info);
25512550
if (err)
@@ -2561,9 +2560,7 @@ int __init cgroup_init(void)
25612560
if (err < 0)
25622561
goto out;
25632562

2564-
entry = create_proc_entry("cgroups", 0, NULL);
2565-
if (entry)
2566-
entry->proc_fops = &proc_cgroupstats_operations;
2563+
proc_create("cgroups", 0, NULL, &proc_cgroupstats_operations);
25672564

25682565
out:
25692566
if (err)

0 commit comments

Comments
 (0)