aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/proc_ppc64.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/kernel/proc_ppc64.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/kernel/proc_ppc64.c')
-rw-r--r--arch/powerpc/kernel/proc_ppc64.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/powerpc/kernel/proc_ppc64.c b/arch/powerpc/kernel/proc_ppc64.c
index f78dfce1b771..c647ddef40dc 100644
--- a/arch/powerpc/kernel/proc_ppc64.c
+++ b/arch/powerpc/kernel/proc_ppc64.c
@@ -68,12 +68,11 @@ static int __init proc_ppc64_init(void)
68{ 68{
69 struct proc_dir_entry *pde; 69 struct proc_dir_entry *pde;
70 70
71 pde = create_proc_entry("ppc64/systemcfg", S_IFREG|S_IRUGO, NULL); 71 pde = proc_create_data("ppc64/systemcfg", S_IFREG|S_IRUGO, NULL,
72 &page_map_fops, vdso_data);
72 if (!pde) 73 if (!pde)
73 return 1; 74 return 1;
74 pde->data = vdso_data;
75 pde->size = PAGE_SIZE; 75 pde->size = PAGE_SIZE;
76 pde->proc_fops = &page_map_fops;
77 76
78 return 0; 77 return 0;
79} 78}