Skip to content

Commit b685b53

Browse files
committed
net/netfilter: Replace rcu_swap_protected() with rcu_replace_pointer()
This commit replaces the use of rcu_swap_protected() with the more intuitively appealing rcu_replace_pointer() as a step towards removing rcu_swap_protected(). Link: https://lore.kernel.org/lkml/CAHk-=wiAsJLw1egFEE=Z7-GGtM6wcvtyytXZA1+BHqta4gg6Hw@mail.gmail.com/ Reported-by: Linus Torvalds <[email protected]> [ paulmck: From rcu_replace() to rcu_replace_pointer() per Ingo Molnar. ] Signed-off-by: Paul E. McKenney <[email protected]> Acked-by: Pablo Neira Ayuso <[email protected]> Cc: Jozsef Kadlecsik <[email protected]> Cc: Florian Westphal <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: <[email protected]> Cc: <[email protected]> Cc: <[email protected]>
1 parent e3f0d76 commit b685b53

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

net/netfilter/nf_tables_api.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1461,8 +1461,9 @@ static void nft_chain_stats_replace(struct nft_trans *trans)
14611461
if (!nft_trans_chain_stats(trans))
14621462
return;
14631463

1464-
rcu_swap_protected(chain->stats, nft_trans_chain_stats(trans),
1465-
lockdep_commit_lock_is_held(trans->ctx.net));
1464+
nft_trans_chain_stats(trans) =
1465+
rcu_replace_pointer(chain->stats, nft_trans_chain_stats(trans),
1466+
lockdep_commit_lock_is_held(trans->ctx.net));
14661467

14671468
if (!nft_trans_chain_stats(trans))
14681469
static_branch_inc(&nft_counters_enabled);

0 commit comments

Comments
 (0)