[NETFILTER]: nf_log: use rcu_assign_pointer for RCU protected pointer
[powerpc.git] / net / netfilter / nf_log.c
index 3e76bd0..a3ff88d 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/module.h>
@@ -47,11 +46,11 @@ int nf_log_unregister_pf(int pf)
                return -EINVAL;
 
        spin_lock(&nf_log_lock);
-       nf_logging[pf] = NULL;
+       rcu_assign_pointer(nf_logging[pf], NULL);
        spin_unlock(&nf_log_lock);
 
        /* Give time to concurrent readers. */
-       synchronize_net();
+       synchronize_rcu();
 
        return 0;
 }
@@ -64,11 +63,11 @@ void nf_log_unregister_logger(struct nf_logger *logger)
        spin_lock(&nf_log_lock);
        for (i = 0; i < NPROTO; i++) {
                if (nf_logging[i] == logger)
-                       nf_logging[i] = NULL;
+                       rcu_assign_pointer(nf_logging[i], NULL);
        }
        spin_unlock(&nf_log_lock);
 
-       synchronize_net();
+       synchronize_rcu();
 }
 EXPORT_SYMBOL(nf_log_unregister_logger);
 
@@ -152,7 +151,7 @@ static int nflog_open(struct inode *inode, struct file *file)
        return seq_open(file, &nflog_seq_ops);
 }
 
-static struct file_operations nflog_file_ops = {
+static const struct file_operations nflog_file_ops = {
        .owner   = THIS_MODULE,
        .open    = nflog_open,
        .read    = seq_read,