]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
staging: dgrp: cleanup sparse warnings
authorNathan Zimmer <nzimmer@sgi.com>
Wed, 13 Mar 2013 18:05:59 +0000 (13:05 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 14 Mar 2013 20:40:58 +0000 (13:40 -0700)
A cleanup patch to remove sparse warnings caused by my other patch
"procfs: Improve Scaling in proc" since now proc_fops is protected by the rcu.

Signed-off-by: Nathan Zimmer <nzimmer@sgi.com>
Cc: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/dgrp/dgrp_dpa_ops.c
drivers/staging/dgrp/dgrp_mon_ops.c
drivers/staging/dgrp/dgrp_net_ops.c
drivers/staging/dgrp/dgrp_ports_ops.c
drivers/staging/dgrp/dgrp_specproc.c

index 021cca498f2c510ccb6bcd63a23582e39b094f16..67fb3d6c45ea01709329ed33b84f1e5cf1eb8f47 100644 (file)
@@ -116,7 +116,7 @@ void dgrp_register_dpa_hook(struct proc_dir_entry *de)
        struct nd_struct *node = de->data;
 
        de->proc_iops = &dpa_inode_ops;
-       de->proc_fops = &dpa_ops;
+       rcu_assign_pointer(de->proc_fops, &dpa_ops);
 
        node->nd_dpa_de = de;
        spin_lock_init(&node->nd_dpa_lock);
index 4792d056a36532b179968dda51f73b37ce56cb95..b484fccb494e96852fecd01e0a2e497ee5371710 100644 (file)
@@ -66,7 +66,7 @@ void dgrp_register_mon_hook(struct proc_dir_entry *de)
        struct nd_struct *node = de->data;
 
        de->proc_iops = &mon_inode_ops;
-       de->proc_fops = &mon_ops;
+       rcu_assign_pointer(de->proc_fops, &mon_ops);
        node->nd_mon_de = de;
        sema_init(&node->nd_mon_semaphore, 1);
 }
index f364e8e1722dab4985a311d1bef34e70947646e8..64f48ffb9d4e70a7f89f2d13d8ff8214f247708e 100644 (file)
@@ -91,7 +91,7 @@ void dgrp_register_net_hook(struct proc_dir_entry *de)
        struct nd_struct *node = de->data;
 
        de->proc_iops = &net_inode_ops;
-       de->proc_fops = &net_ops;
+       rcu_assign_pointer(de->proc_fops, &net_ops);
        node->nd_net_de = de;
        sema_init(&node->nd_net_semaphore, 1);
        node->nd_state = NS_CLOSED;
index cd1fc20886242f27a38b0b17f4c5880a47ba8835..f93dc1f262f5b9dfc0fbb83da71c8d9faee7af14 100644 (file)
@@ -65,7 +65,7 @@ void dgrp_register_ports_hook(struct proc_dir_entry *de)
        struct nd_struct *node = de->data;
 
        de->proc_iops = &ports_inode_ops;
-       de->proc_fops = &ports_ops;
+       rcu_assign_pointer(de->proc_fops, &ports_ops);
        node->nd_ports_de = de;
 }
 
index 73f287f966046b7f89ff5e4a6c3038f9c98d6d52..d66712c8aa9453f4e6b2f8b22b3fcc4ebaf6628e 100644 (file)
@@ -271,9 +271,11 @@ static void register_proc_table(struct dgrp_proc_entry *table,
                        if (!table->child) {
                                de->proc_iops = &proc_inode_ops;
                                if (table->proc_file_ops)
-                                       de->proc_fops = table->proc_file_ops;
+                                       rcu_assign_pointer(de->proc_fops,
+                                                       table->proc_file_ops);
                                else
-                                       de->proc_fops = &dgrp_proc_file_ops;
+                                       rcu_assign_pointer(de->proc_fops,
+                                                        &dgrp_proc_file_ops);
                        }
                }
                table->de = de;