lkml.org 
[lkml]   [2008]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 2/2] 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>
---
kernel/cgroup.c | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 8d833b6..8d45126 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -2489,7 +2489,6 @@ int __init cgroup_init(void)
{
int err;
int i;
- struct proc_dir_entry *entry;

err = bdi_init(&cgroup_backing_dev_info);
if (err)
@@ -2505,9 +2504,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)
--
1.5.4.rc3

\
 
 \ /
  Last update: 2008-03-10 08:33    [W:0.039 / U:2.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site