[PATCH 9/29] sysvipc: use non-racy method for proc entries creation

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Denis V. Lunev
Date: Tuesday, April 8, 2008 - 4:19 am

Use 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>
---
 ipc/util.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/ipc/util.c b/ipc/util.c
index 4c465cb..3339177 100644
--- a/ipc/util.c
+++ b/ipc/util.c
@@ -165,13 +165,12 @@ void __init ipc_init_proc_interface(const char *path, const char *header,
 	iface->ids	= ids;
 	iface->show	= show;
 
-	pde = create_proc_entry(path,
-				S_IRUGO,        /* world readable */
-				NULL            /* parent dir */);
-	if (pde) {
-		pde->data = iface;
-		pde->proc_fops = &sysvipc_proc_fops;
-	} else {
+	pde = proc_create_data(path,
+			       S_IRUGO,        /* world readable */
+			       NULL,           /* parent dir */
+			       &sysvipc_proc_fops,
+			       iface);
+	if (!pde) {
 		kfree(iface);
 	}
 }
-- 
1.5.3.rc5

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/29] proc entries creation race, Denis V. Lunev, (Tue Apr 8, 4:18 am)
[PATCH 9/29] sysvipc: use non-racy method for proc entries ..., Denis V. Lunev, (Tue Apr 8, 4:19 am)
[patch, -git] isdn: hysdn_procconf.c build fix, Ingo Molnar, (Wed Apr 30, 10:57 am)
Re: [patch, -git] isdn: hysdn_procconf.c build fix, Andrew Morton, (Wed Apr 30, 11:10 am)
Re: [patch, -git] isdn: hysdn_procconf.c build fix, Ingo Molnar, (Wed Apr 30, 11:30 am)
Re: [patch, -git] isdn: hysdn_procconf.c build fix, Andrew Morton, (Wed Apr 30, 11:47 am)
Re: [patch, -git] isdn: hysdn_procconf.c build fix, Denis V. Lunev, (Wed Apr 30, 12:03 pm)
Re: [patch, -git] isdn: hysdn_procconf.c build fix, Andrew Morton, (Wed Apr 30, 12:14 pm)
Re: [patch, -git] isdn: hysdn_procconf.c build fix, Harvey Harrison, (Wed Apr 30, 12:24 pm)
Re: [patch, -git] isdn: hysdn_procconf.c build fix, Alexey Dobriyan, (Wed Apr 30, 2:21 pm)