]> git.karo-electronics.de Git - linux-beck.git/commit
rcu: Add an RCU_INITIALIZER for global RCU-protected pointers
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Mon, 11 Nov 2013 17:59:34 +0000 (09:59 -0800)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Thu, 12 Dec 2013 20:24:23 +0000 (12:24 -0800)
commit462225ae47d7175f886281d8a91708550cd5178c
tree46048d886502e6a177a485a965f5f3371f545d43
parent9d162cd06349dfee6b4f254b3abf1355cf0aee43
rcu: Add an RCU_INITIALIZER for global RCU-protected pointers

There is currently no way to initialize a global RCU-protected pointer
without either putting up with sparse complaints or open-coding an
obscure cast.  This commit therefore creates RCU_INITIALIZER(), which
is intended to be used as follows:

struct foo __rcu *p = RCU_INITIALIZER(&my_rcu_structure);

This commit also applies RCU_INITIALIZER() to eliminate repeated
open-coded obscure casts in __rcu_assign_pointer(), RCU_INIT_POINTER(),
and RCU_POINTER_INITIALIZER().  This commit also inlines
__rcu_assign_pointer() into its only caller, rcu_assign_pointer().

Suggested-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
include/linux/rcupdate.h