summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2008-04-29 01:02:16 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-29 08:06:21 -0700
commit16e70f64a9358133a14872eb72cf39b6f38b6212 (patch)
tree0ed4ea5d67aff278a4e27f0ec6ff7c7f7b2906b6
parent659f865ea65a60564ce00a0c571099d1fa55e8e3 (diff)
downloadlwn-16e70f64a9358133a14872eb72cf39b6f38b6212.tar.gz
lwn-16e70f64a9358133a14872eb72cf39b6f38b6212.zip
samples: use non-racy method for /proc/marker-example creation
Use proc_create() to make sure that ->proc_fops be setup before gluing PDE to main tree. Signed-off-by: Denis V. Lunev <den@openvz.org> Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> Cc: Alexey Dobriyan <adobriyan@gmail.com> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--samples/markers/marker-example.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/samples/markers/marker-example.c b/samples/markers/marker-example.c
index 05e438f8b4e2..e90dc5d04392 100644
--- a/samples/markers/marker-example.c
+++ b/samples/markers/marker-example.c
@@ -33,10 +33,8 @@ static struct file_operations mark_ops = {
static int example_init(void)
{
printk(KERN_ALERT "example init\n");
- pentry_example = create_proc_entry("marker-example", 0444, NULL);
- if (pentry_example)
- pentry_example->proc_fops = &mark_ops;
- else
+ pentry_example = proc_create("marker-example", 0444, NULL, &mark_ops);
+ if (!pentry_example)
return -EPERM;
return 0;
}