summaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@kernel.org>2019-09-24 00:42:28 +0200
committerPaul E. McKenney <paulmck@kernel.org>2019-10-30 16:45:26 +0100
commite3f0d761fcaec5d445c9280d6e09087dc32828d2 (patch)
treea3d337505d464ae77766ac7a9f3296b243128f47 /net/core
parentbpf/cgroup: Replace rcu_swap_protected() with rcu_replace_pointer() (diff)
downloadlinux-e3f0d761fcaec5d445c9280d6e09087dc32828d2.tar.xz
linux-e3f0d761fcaec5d445c9280d6e09087dc32828d2.zip
net/core: 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 <torvalds@linux-foundation.org> [ paulmck: From rcu_replace() to rcu_replace_pointer() per Ingo Molnar. ] Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Cc: "David S. Miller" <davem@davemloft.net> Cc: Jiri Pirko <jiri@mellanox.com> Cc: Eric Dumazet <edumazet@google.com> Cc: Ido Schimmel <idosch@mellanox.com> Cc: Petr Machata <petrm@mellanox.com> Cc: Paolo Abeni <pabeni@redhat.com> Cc: <netdev@vger.kernel.org>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/dev.c4
-rw-r--r--net/core/sock_reuseport.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index bf3ed413abaf..c5d8882d100f 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1288,8 +1288,8 @@ int dev_set_alias(struct net_device *dev, const char *alias, size_t len)
}
mutex_lock(&ifalias_mutex);
- rcu_swap_protected(dev->ifalias, new_alias,
- mutex_is_locked(&ifalias_mutex));
+ new_alias = rcu_replace_pointer(dev->ifalias, new_alias,
+ mutex_is_locked(&ifalias_mutex));
mutex_unlock(&ifalias_mutex);
if (new_alias)
diff --git a/net/core/sock_reuseport.c b/net/core/sock_reuseport.c
index f3ceec93f392..f19f179538b9 100644
--- a/net/core/sock_reuseport.c
+++ b/net/core/sock_reuseport.c
@@ -356,8 +356,8 @@ int reuseport_detach_prog(struct sock *sk)
spin_lock_bh(&reuseport_lock);
reuse = rcu_dereference_protected(sk->sk_reuseport_cb,
lockdep_is_held(&reuseport_lock));
- rcu_swap_protected(reuse->prog, old_prog,
- lockdep_is_held(&reuseport_lock));
+ old_prog = rcu_replace_pointer(reuse->prog, old_prog,
+ lockdep_is_held(&reuseport_lock));
spin_unlock_bh(&reuseport_lock);
if (!old_prog)