aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/iseries/mf.c
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/iseries/mf.c
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/iseries/mf.c')
-rw-r--r--arch/powerpc/platforms/iseries/mf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/powerpc/platforms/iseries/mf.c b/arch/powerpc/platforms/iseries/mf.c
index c0f2433bc16e..1dc7295746da 100644
--- a/arch/powerpc/platforms/iseries/mf.c
+++ b/arch/powerpc/platforms/iseries/mf.c
@@ -1255,11 +1255,11 @@ static int __init mf_proc_init(void)
1255 if (i == 3) /* no vmlinux entry for 'D' */ 1255 if (i == 3) /* no vmlinux entry for 'D' */
1256 continue; 1256 continue;
1257 1257
1258 ent = create_proc_entry("vmlinux", S_IFREG|S_IWUSR, mf); 1258 ent = proc_create_data("vmlinux", S_IFREG|S_IWUSR, mf,
1259 &proc_vmlinux_operations,
1260 (void *)(long)i);
1259 if (!ent) 1261 if (!ent)
1260 return 1; 1262 return 1;
1261 ent->data = (void *)(long)i;
1262 ent->proc_fops = &proc_vmlinux_operations;
1263 } 1263 }
1264 1264
1265 ent = create_proc_entry("side", S_IFREG|S_IRUSR|S_IWUSR, mf_proc_root); 1265 ent = create_proc_entry("side", S_IFREG|S_IRUSR|S_IWUSR, mf_proc_root);