[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1207653576-12640-13-git-send-email-den@openvz.org>
Date: Tue, 8 Apr 2008 15:19:20 +0400
From: "Denis V. Lunev" <den@...nvz.org>
To: akpm@...ux-foundation.org
Cc: linux-kernel@...r.kernel.org, "Denis V. Lunev" <den@...nvz.org>
Subject: [PATCH 13/29] 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@...nvz.org>
CC: Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>
---
samples/markers/marker-example.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/samples/markers/marker-example.c b/samples/markers/marker-example.c
index 05e438f..e90dc5d 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;
}
--
1.5.3.rc5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists