Skip to contentSkip to conversation

: Use proc_create() to setup ->proc_fops first

PATCH Applied Wang Chen 2 participants 2 messages Feb 28, 2008

Subsystems (3)
lore
Share & tools
lore

Wang Chen

author
#0 lore raw

PATCH 12/15 : Use proc_create() to setup ->proc_fops first

Use proc_create() to make sure that ->proc_fops be setup before gluing PDE to main tree.

---
 net/ipv4/route.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
net/ipv4/route.c +2 -3
index 525787b..7b5e8e1 100644
@@ -542,12 +542,11 @@ static __init int ip_rt_proc_init(struct net *net)
 	if (!pde)
 		goto err1;
 
-	pde = create_proc_entry("rt_cache", S_IRUGO, net->proc_net_stat);
+	pde = proc_create("rt_cache", S_IRUGO,
+			  net->proc_net_stat, &rt_cpu_seq_fops);
 	if (!pde)
 		goto err2;
 
-	pde->proc_fops = &rt_cpu_seq_fops;
-
 #ifdef CONFIG_NET_CLS_ROUTE
 	pde = create_proc_read_entry("rt_acct", 0, net->proc_net,
 			ip_rt_acct_read, NULL);
Signature · 1 line
WCN