Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-next-2.6
[sfrench/cifs-2.6.git] / net / ipv6 / netfilter / ip6_tables.c
index 4c1492ff473c7869cad0908496ac038201788337..94874b0bdcdcf9835fe0b0b53fd088c12db93305 100644 (file)
@@ -340,6 +340,7 @@ ip6t_do_table(struct sk_buff *skb,
        unsigned int *stackptr, origptr, cpu;
        const struct xt_table_info *private;
        struct xt_action_param acpar;
+       unsigned int addend;
 
        /* Initialization */
        indev = in ? in->name : nulldevname;
@@ -358,7 +359,8 @@ ip6t_do_table(struct sk_buff *skb,
 
        IP_NF_ASSERT(table->valid_hooks & (1 << hook));
 
-       xt_info_rdlock_bh();
+       local_bh_disable();
+       addend = xt_write_recseq_begin();
        private = table->private;
        cpu        = smp_processor_id();
        table_base = private->entries[cpu];
@@ -442,7 +444,9 @@ ip6t_do_table(struct sk_buff *skb,
        } while (!acpar.hotdrop);
 
        *stackptr = origptr;
-       xt_info_rdunlock_bh();
+
+       xt_write_recseq_end(addend);
+       local_bh_enable();
 
 #ifdef DEBUG_ALLOW_ALL
        return NF_ACCEPT;
@@ -899,7 +903,7 @@ get_counters(const struct xt_table_info *t,
        unsigned int i;
 
        for_each_possible_cpu(cpu) {
-               seqlock_t *lock = &per_cpu(xt_info_locks, cpu).lock;
+               seqcount_t *s = &per_cpu(xt_recseq, cpu);
 
                i = 0;
                xt_entry_foreach(iter, t->entries[cpu], t->size) {
@@ -907,10 +911,10 @@ get_counters(const struct xt_table_info *t,
                        unsigned int start;
 
                        do {
-                               start = read_seqbegin(lock);
+                               start = read_seqcount_begin(s);
                                bcnt = iter->counters.bcnt;
                                pcnt = iter->counters.pcnt;
-                       } while (read_seqretry(lock, start));
+                       } while (read_seqcount_retry(s, start));
 
                        ADD_COUNTER(counters[i], bcnt, pcnt);
                        ++i;
@@ -1325,6 +1329,7 @@ do_add_counters(struct net *net, const void __user *user, unsigned int len,
        int ret = 0;
        const void *loc_cpu_entry;
        struct ip6t_entry *iter;
+       unsigned int addend;
 #ifdef CONFIG_COMPAT
        struct compat_xt_counters_info compat_tmp;
 
@@ -1381,13 +1386,13 @@ do_add_counters(struct net *net, const void __user *user, unsigned int len,
        i = 0;
        /* Choose the copy that is on our node */
        curcpu = smp_processor_id();
-       xt_info_wrlock(curcpu);
+       addend = xt_write_recseq_begin();
        loc_cpu_entry = private->entries[curcpu];
        xt_entry_foreach(iter, loc_cpu_entry, private->size) {
                ADD_COUNTER(iter->counters, paddc[i].bcnt, paddc[i].pcnt);
                ++i;
        }
-       xt_info_wrunlock(curcpu);
+       xt_write_recseq_end(addend);
 
  unlock_up_free:
        local_bh_enable();