Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 066bb1c8 authored by Paul E. McKenney's avatar Paul E. McKenney
Browse files

doc: Update rcu_assign_pointer() definition in whatisRCU.txt



The rcu_assign_pointer() macro has changed over time, and the version
in Documentation/RCU/whatisRCU.txt has not kept up.  This commit brings
it into 2017, albeit in a simplified fashion.

Reported-by: default avatarAndrea Parri <parri.andrea@gmail.com>
Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
parent 6771853b
Loading
Loading
Loading
Loading
+15 −14
Original line number Diff line number Diff line
@@ -587,16 +587,17 @@ It is extremely simple:
		write_unlock(&rcu_gp_mutex);
	}

[You can ignore rcu_assign_pointer() and rcu_dereference() without
missing much.  But here they are anyway.  And whatever you do, don't
forget about them when submitting patches making use of RCU!]
[You can ignore rcu_assign_pointer() and rcu_dereference() without missing
much.  But here are simplified versions anyway.  And whatever you do,
don't forget about them when submitting patches making use of RCU!]

	#define rcu_assign_pointer(p, v)	({ \
							smp_wmb(); \
							(p) = (v); \
	#define rcu_assign_pointer(p, v) \
	({ \
		smp_store_release(&(p), (v)); \
	})

	#define rcu_dereference(p)     ({ \
	#define rcu_dereference(p) \
	({ \
		typeof(p) _________p1 = p; \
		smp_read_barrier_depends(); \
		(_________p1); \