[APPLETALK]: Use proc_create() to setup ->proc_fops first
authorWang Chen <wangchen@cn.fujitsu.com>
Thu, 28 Feb 2008 20:53:32 +0000 (12:53 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 28 Feb 2008 20:53:32 +0000 (12:53 -0800)
As Davem mentioned in his recently patch
(d9595a7b9c777d45a74774f1428c263a0a47f4c0)
that the procfs visibility should occur after
the ->proc_fops are setup.

And also, Alexey provide proc_create() to make
sure that ->proc_fops is setup before gluing PDE
to main tree.

We use proc_create().

Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/appletalk/atalk_proc.c

index 8e8dcfd532dbba7ca73edae10ec88a52879ef08f..162199a2d74f18e6b41ee7322c2ed8d66dfc4539 100644 (file)
@@ -283,25 +283,24 @@ int __init atalk_proc_init(void)
                goto out;
        atalk_proc_dir->owner = THIS_MODULE;
 
-       p = create_proc_entry("interface", S_IRUGO, atalk_proc_dir);
+       p = proc_create("interface", S_IRUGO, atalk_proc_dir,
+                       &atalk_seq_interface_fops);
        if (!p)
                goto out_interface;
-       p->proc_fops = &atalk_seq_interface_fops;
 
-       p = create_proc_entry("route", S_IRUGO, atalk_proc_dir);
+       p = proc_create("route", S_IRUGO, atalk_proc_dir,
+                       &atalk_seq_route_fops);
        if (!p)
                goto out_route;
-       p->proc_fops = &atalk_seq_route_fops;
 
-       p = create_proc_entry("socket", S_IRUGO, atalk_proc_dir);
+       p = proc_create("socket", S_IRUGO, atalk_proc_dir,
+                       &atalk_seq_socket_fops);
        if (!p)
                goto out_socket;
-       p->proc_fops = &atalk_seq_socket_fops;
 
-       p = create_proc_entry("arp", S_IRUGO, atalk_proc_dir);
+       p = proc_create("arp", S_IRUGO, atalk_proc_dir, &atalk_seq_arp_fops);
        if (!p)
                goto out_arp;
-       p->proc_fops = &atalk_seq_arp_fops;
 
        rc = 0;
 out: