aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/cell/spufs
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2008-04-29 04:02:26 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-29 11:06:22 -0400
commit667471386d4068e75a6a55b615701ced61eb6333 (patch)
tree2bf51dfa6209ca6637c1cff084b15c132b280ab0 /arch/powerpc/platforms/cell/spufs
parent6f1c86ec315711d21666751b0bdae69ce2c6d589 (diff)
powerpc: 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. Add correct ->owner to proc_fops to fix reading/module unloading race. Signed-off-by: Denis V. Lunev <den@openvz.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> 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/powerpc/platforms/cell/spufs')
-rw-r--r--arch/powerpc/platforms/cell/spufs/sched.c3
-rw-r--r--arch/powerpc/platforms/cell/spufs/sputrace.c3
2 files changed, 2 insertions, 4 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c
index 00528ef84ad2..45dcd2693502 100644
--- a/arch/powerpc/platforms/cell/spufs/sched.c
+++ b/arch/powerpc/platforms/cell/spufs/sched.c
@@ -1063,10 +1063,9 @@ int __init spu_sched_init(void)
1063 1063
1064 mod_timer(&spuloadavg_timer, 0); 1064 mod_timer(&spuloadavg_timer, 0);
1065 1065
1066 entry = create_proc_entry("spu_loadavg", 0, NULL); 1066 entry = proc_create("spu_loadavg", 0, NULL, &spu_loadavg_fops);
1067 if (!entry) 1067 if (!entry)
1068 goto out_stop_kthread; 1068 goto out_stop_kthread;
1069 entry->proc_fops = &spu_loadavg_fops;
1070 1069
1071 pr_debug("spusched: tick: %d, min ticks: %d, default ticks: %d\n", 1070 pr_debug("spusched: tick: %d, min ticks: %d, default ticks: %d\n",
1072 SPUSCHED_TICK, MIN_SPU_TIMESLICE, DEF_SPU_TIMESLICE); 1071 SPUSCHED_TICK, MIN_SPU_TIMESLICE, DEF_SPU_TIMESLICE);
diff --git a/arch/powerpc/platforms/cell/spufs/sputrace.c b/arch/powerpc/platforms/cell/spufs/sputrace.c
index 79aa773f3c99..aea5286f1245 100644
--- a/arch/powerpc/platforms/cell/spufs/sputrace.c
+++ b/arch/powerpc/platforms/cell/spufs/sputrace.c
@@ -201,10 +201,9 @@ static int __init sputrace_init(void)
201 if (!sputrace_log) 201 if (!sputrace_log)
202 goto out; 202 goto out;
203 203
204 entry = create_proc_entry("sputrace", S_IRUSR, NULL); 204 entry = proc_create("sputrace", S_IRUSR, NULL, &sputrace_fops);
205 if (!entry) 205 if (!entry)
206 goto out_free_log; 206 goto out_free_log;
207 entry->proc_fops = &sputrace_fops;
208 207
209 for (i = 0; i < ARRAY_SIZE(spu_probes); i++) { 208 for (i = 0; i < ARRAY_SIZE(spu_probes); i++) {
210 struct spu_probe *p = &spu_probes[i]; 209 struct spu_probe *p = &spu_probes[i];