[PATCH 5/29] ext4: 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()/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: sct@redhat.com
CC: adilger@clusterfs.com
CC: linux-ext4@vger.kernel.org
---
 fs/ext4/mballoc.c |   15 ++++-----------
 1 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 9a6c70f..cbb47a0 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -2455,17 +2455,10 @@ static void ext4_mb_history_init(struct super_block *sb)
 	int i;
 
 	if (sbi->s_mb_proc != NULL) {
-		struct proc_dir_entry *p;
-		p = create_proc_entry("mb_history", S_IRUGO, sbi->s_mb_proc);
-		if (p) {
-			p->proc_fops = &ext4_mb_seq_history_fops;
-			p->data = sb;
-		}
-		p = create_proc_entry("mb_groups", S_IRUGO, sbi->s_mb_proc);
-		if (p) {
-			p->proc_fops = &ext4_mb_seq_groups_fops;
-			p->data = sb;
-		}
+		proc_create_data("mb_history", S_IRUGO, sbi->s_mb_proc,
+				 &ext4_mb_seq_history_fops, sb);
+		proc_create_data("mb_groups", S_IRUGO, sbi->s_mb_proc,
+				 &ext4_mb_seq_groups_fops, sb);
 	}
 
 	sbi->s_mb_history_max = 1000;
-- 
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 5/29] ext4: use non-racy method for proc entries cr ..., 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)