From: Li Zefan <lizf@cn.fujitsu.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Paul Menage <menage@google.com>, LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 2/2] cgroup: switch to proc_create()
Date: Mon, 10 Mar 2008 16:30:52 +0900 [thread overview]
Message-ID: <47D4E3AC.2020600@cn.fujitsu.com> (raw)
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
next reply other threads:[~2008-03-10 7:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-10 7:30 Li Zefan [this message]
2008-03-10 21:01 ` [PATCH 2/2] cgroup: switch to proc_create() Paul Menage
2008-03-10 23:43 ` Li Zefan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47D4E3AC.2020600@cn.fujitsu.com \
--to=lizf@cn.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=menage@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox