Commit c8d1da4000b0b95bf95d3e13b7450eec5428da1e

Authored by Paul E. McKenney
Committed by Pablo Neira Ayuso
1 parent b966098769

netfilter: Replace call_rcu_bh(), rcu_barrier_bh(), and synchronize_rcu_bh()

Now that call_rcu()'s callback is not invoked until after bh-disable
regions of code have completed (in addition to explicitly marked
RCU read-side critical sections), call_rcu() can be used in place
of call_rcu_bh().  Similarly, rcu_barrier() can be used in place of
rcu_barrier_bh() and synchronize_rcu() in place of synchronize_rcu_bh().
This commit therefore makes these changes.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

Showing 4 changed files with 8 additions and 8 deletions Side-by-side Diff

net/ipv4/netfilter/ipt_CLUSTERIP.c
... ... @@ -94,7 +94,7 @@
94 94 clusterip_config_put(struct clusterip_config *c)
95 95 {
96 96 if (refcount_dec_and_test(&c->refcount))
97   - call_rcu_bh(&c->rcu, clusterip_config_rcu_free);
  97 + call_rcu(&c->rcu, clusterip_config_rcu_free);
98 98 }
99 99  
100 100 /* decrease the count of entries using/referencing this config. If last
... ... @@ -876,8 +876,8 @@
876 876 xt_unregister_target(&clusterip_tg_reg);
877 877 unregister_pernet_subsys(&clusterip_net_ops);
878 878  
879   - /* Wait for completion of call_rcu_bh()'s (clusterip_config_rcu_free) */
880   - rcu_barrier_bh();
  879 + /* Wait for completion of call_rcu()'s (clusterip_config_rcu_free) */
  880 + rcu_barrier();
881 881 }
882 882  
883 883 module_init(clusterip_tg_init);
net/netfilter/ipset/ip_set_hash_gen.h
... ... @@ -67,7 +67,7 @@
67 67  
68 68 /* A hash bucket */
69 69 struct hbucket {
70   - struct rcu_head rcu; /* for call_rcu_bh */
  70 + struct rcu_head rcu; /* for call_rcu */
71 71 /* Which positions are used in the array */
72 72 DECLARE_BITMAP(used, AHASH_MAX_TUNED);
73 73 u8 size; /* size of the array */
... ... @@ -664,7 +664,7 @@
664 664 spin_unlock_bh(&set->lock);
665 665  
666 666 /* Give time to other readers of the set */
667   - synchronize_rcu_bh();
  667 + synchronize_rcu();
668 668  
669 669 pr_debug("set %s resized from %u (%p) to %u (%p)\n", set->name,
670 670 orig->htable_bits, orig, t->htable_bits, t);
net/netfilter/nfnetlink_log.c
... ... @@ -148,7 +148,7 @@
148 148 instance_put(struct nfulnl_instance *inst)
149 149 {
150 150 if (inst && refcount_dec_and_test(&inst->use))
151   - call_rcu_bh(&inst->rcu, nfulnl_instance_free_rcu);
  151 + call_rcu(&inst->rcu, nfulnl_instance_free_rcu);
152 152 }
153 153  
154 154 static void nfulnl_timer(struct timer_list *t);
net/netfilter/xt_hashlimit.c
... ... @@ -260,7 +260,7 @@
260 260 dsthash_free(struct xt_hashlimit_htable *ht, struct dsthash_ent *ent)
261 261 {
262 262 hlist_del_rcu(&ent->node);
263   - call_rcu_bh(&ent->rcu, dsthash_free_rcu);
  263 + call_rcu(&ent->rcu, dsthash_free_rcu);
264 264 ht->count--;
265 265 }
266 266 static void htable_gc(struct work_struct *work);
... ... @@ -1329,7 +1329,7 @@
1329 1329 xt_unregister_matches(hashlimit_mt_reg, ARRAY_SIZE(hashlimit_mt_reg));
1330 1330 unregister_pernet_subsys(&hashlimit_net_ops);
1331 1331  
1332   - rcu_barrier_bh();
  1332 + rcu_barrier();
1333 1333 kmem_cache_destroy(hashlimit_cachep);
1334 1334 }
1335 1335