aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/kernel
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2008-04-29 04:02:25 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-29 11:06:21 -0400
commite23637681bef5b69a68c8ac399732b941f1af023 (patch)
tree90cc355ac83b58080da3213b99351717d9f0ffb6 /arch/ia64/kernel
parentc293819a3caa77d96b801a7795f81a5913ec21d7 (diff)
ia64: use non-racy method for proc entries creation
Use proc_create()/proc_create_data() to make sure that ->proc_fops and ->data be setup before gluing PDE to main tree. Signed-off-by: Denis V. Lunev <den@openvz.org> Cc: Tony Luck <tony.luck@intel.com> 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>
Diffstat (limited to 'arch/ia64/kernel')
-rw-r--r--arch/ia64/kernel/perfmon.c6
-rw-r--r--arch/ia64/kernel/salinfo.c10
2 files changed, 5 insertions, 11 deletions
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index c8e403752a0c..7fbb51e10bbe 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -6695,16 +6695,12 @@ pfm_init(void)
6695 /* 6695 /*
6696 * create /proc/perfmon (mostly for debugging purposes) 6696 * create /proc/perfmon (mostly for debugging purposes)
6697 */ 6697 */
6698 perfmon_dir = create_proc_entry("perfmon", S_IRUGO, NULL); 6698 perfmon_dir = proc_create("perfmon", S_IRUGO, NULL, &pfm_proc_fops);
6699 if (perfmon_dir == NULL) { 6699 if (perfmon_dir == NULL) {
6700 printk(KERN_ERR "perfmon: cannot create /proc entry, perfmon disabled\n"); 6700 printk(KERN_ERR "perfmon: cannot create /proc entry, perfmon disabled\n");
6701 pmu_conf = NULL; 6701 pmu_conf = NULL;
6702 return -1; 6702 return -1;
6703 } 6703 }
6704 /*
6705 * install customized file operations for /proc/perfmon entry
6706 */
6707 perfmon_dir->proc_fops = &pfm_proc_fops;
6708 6704
6709 /* 6705 /*
6710 * create /proc/sys/kernel/perfmon (for debugging purposes) 6706 * create /proc/sys/kernel/perfmon (for debugging purposes)
diff --git a/arch/ia64/kernel/salinfo.c b/arch/ia64/kernel/salinfo.c
index b11bb50a197a..ecb9eb78d687 100644
--- a/arch/ia64/kernel/salinfo.c
+++ b/arch/ia64/kernel/salinfo.c
@@ -648,18 +648,16 @@ salinfo_init(void)
648 if (!dir) 648 if (!dir)
649 continue; 649 continue;
650 650
651 entry = create_proc_entry("event", S_IRUSR, dir); 651 entry = proc_create_data("event", S_IRUSR, dir,
652 &salinfo_event_fops, data);
652 if (!entry) 653 if (!entry)
653 continue; 654 continue;
654 entry->data = data;
655 entry->proc_fops = &salinfo_event_fops;
656 *sdir++ = entry; 655 *sdir++ = entry;
657 656
658 entry = create_proc_entry("data", S_IRUSR | S_IWUSR, dir); 657 entry = proc_create_data("data", S_IRUSR | S_IWUSR, dir,
658 &salinfo_data_fops, data);
659 if (!entry) 659 if (!entry)
660 continue; 660 continue;
661 entry->data = data;
662 entry->proc_fops = &salinfo_data_fops;
663 *sdir++ = entry; 661 *sdir++ = entry;
664 662
665 /* we missed any events before now */ 663 /* we missed any events before now */