netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 13/15] [8021Q]: Use proc_create() to setup ->proc_fops first
@ 2008-02-28 10:58 Wang Chen
  2008-02-28 22:15 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Wang Chen @ 2008-02-28 10:58 UTC (permalink / raw)
  To: David S. Miller, NETDEV

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

Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
---
 net/8021q/vlanproc.c |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/net/8021q/vlanproc.c b/net/8021q/vlanproc.c
index a0ec479..146cfb0 100644
--- a/net/8021q/vlanproc.c
+++ b/net/8021q/vlanproc.c
@@ -161,11 +161,10 @@ int __init vlan_proc_init(void)
 	if (!proc_vlan_dir)
 		goto err;
 
-	proc_vlan_conf = create_proc_entry(name_conf, S_IFREG|S_IRUSR|S_IWUSR,
-					   proc_vlan_dir);
+	proc_vlan_conf = proc_create(name_conf, S_IFREG|S_IRUSR|S_IWUSR,
+				     proc_vlan_dir, &vlan_fops);
 	if (!proc_vlan_conf)
 		goto err;
-	proc_vlan_conf->proc_fops = &vlan_fops;
 	return 0;
 
 err:
@@ -182,13 +181,11 @@ int vlan_proc_add_dev(struct net_device *vlandev)
 {
 	struct vlan_dev_info *dev_info = vlan_dev_info(vlandev);
 
-	dev_info->dent = create_proc_entry(vlandev->name,
-					   S_IFREG|S_IRUSR|S_IWUSR,
-					   proc_vlan_dir);
+	dev_info->dent = proc_create(vlandev->name, S_IFREG|S_IRUSR|S_IWUSR,
+				     proc_vlan_dir, &vlandev_fops);
 	if (!dev_info->dent)
 		return -ENOBUFS;
 
-	dev_info->dent->proc_fops = &vlandev_fops;
 	dev_info->dent->data = vlandev;
 	return 0;
 }
-- 
WCN



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 13/15] [8021Q]: Use proc_create() to setup ->proc_fops first
  2008-02-28 10:58 [PATCH 13/15] [8021Q]: Use proc_create() to setup ->proc_fops first Wang Chen
@ 2008-02-28 22:15 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2008-02-28 22:15 UTC (permalink / raw)
  To: wangchen; +Cc: netdev

From: Wang Chen <wangchen@cn.fujitsu.com>
Date: Thu, 28 Feb 2008 18:58:24 +0800

> Use proc_create() to make sure that ->proc_fops be setup before gluing
> PDE to main tree.
> 
> Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>

Applied.

> @@ -182,13 +181,11 @@ int vlan_proc_add_dev(struct net_device *vlandev)
>  {
>  	struct vlan_dev_info *dev_info = vlan_dev_info(vlandev);
>  
> -	dev_info->dent = create_proc_entry(vlandev->name,
> -					   S_IFREG|S_IRUSR|S_IWUSR,
> -					   proc_vlan_dir);
> +	dev_info->dent = proc_create(vlandev->name, S_IFREG|S_IRUSR|S_IWUSR,
> +				     proc_vlan_dir, &vlandev_fops);
>  	if (!dev_info->dent)
>  		return -ENOBUFS;
>  
> -	dev_info->dent->proc_fops = &vlandev_fops;
>  	dev_info->dent->data = vlandev;
>  	return 0;
>  }

->data visibility issue

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-02-28 22:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-28 10:58 [PATCH 13/15] [8021Q]: Use proc_create() to setup ->proc_fops first Wang Chen
2008-02-28 22:15 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).