Paul E. McKenney dfcac203a3 rcu: Upgrade rcu_swap_protected() to rcu_replace_pointer()
[ Upstream commit a63fc6b75cca984c71f095282e0227a390ba88f3 ]

Although the rcu_swap_protected() macro follows the example of
swap(), the interactions with RCU make its update of its argument
somewhat counter-intuitive.  This commit therefore introduces
an rcu_replace_pointer() that returns the old value of the RCU
pointer instead of doing the argument update.  Once all the uses of
rcu_swap_protected() are updated to instead use rcu_replace_pointer(),
rcu_swap_protected() will be removed.

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: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
Cc: Shane M Seymour <shane.seymour@hpe.com>
Cc: Martin K. Petersen <martin.petersen@oracle.com>
Stable-dep-of: a61675294735 ("ieee802154: hwsim: Fix possible memory leaks")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-06-28 10:18:38 +02:00
..
2019-08-09 09:15:05 +02:00
2019-09-17 10:27:46 -07:00
2020-02-19 19:53:09 +01:00
2023-05-30 12:44:04 +01:00
2019-09-19 16:24:24 -07:00
2019-08-20 22:09:52 +02:00
2022-10-26 13:22:39 +02:00
2019-08-28 21:17:12 -06:00
2019-09-17 19:15:14 -07:00
2019-09-23 11:21:04 -07:00
2020-03-25 08:25:58 +01:00
2019-09-05 11:40:54 +02:00
2019-10-02 06:36:50 -07:00
2019-11-08 08:46:49 -08:00
2022-10-26 13:22:46 +02:00
2022-04-15 14:18:32 +02:00
2019-12-13 08:42:53 +01:00
2021-03-04 10:26:29 +01:00
2022-08-25 11:18:04 +02:00
2021-02-07 15:35:49 +01:00
2022-10-07 09:16:54 +02:00
2021-11-17 09:48:17 +01:00
2019-09-29 10:33:41 -07:00
2019-12-13 08:43:18 +01:00
2019-08-14 15:30:35 +02:00
2023-06-21 15:44:10 +02:00
2023-06-21 15:44:10 +02:00
2023-03-17 08:32:52 +01:00
2020-03-18 07:17:46 +01:00
2019-08-01 21:49:46 +02:00
2019-07-31 19:03:35 +02:00
2020-04-02 15:11:00 +02:00
2021-03-07 12:20:49 +01:00
2019-09-07 21:42:25 +02:00
2019-08-01 20:51:22 +02:00
2019-07-31 19:03:35 +02:00
2020-04-02 15:11:00 +02:00
2021-06-10 13:37:14 +02:00