rcu: Add accessor macros for the ->need_future_gp[] array
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Wed, 18 Apr 2018 18:11:39 +0000 (11:11 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Tue, 15 May 2018 17:29:18 +0000 (10:29 -0700)
commitc91a8675b9cc697c725b6d97fcc7f157f4a989d0
tree335a7e265dda2c90ad19b8240b65be694fab0a0e
parent825a9911f6447299a69edacecc81fa2cdc5290a7
rcu: Add accessor macros for the ->need_future_gp[] array

Accessors for the ->need_future_gp[] array are currently open-coded,
which makes them difficult to change.  To improve maintainability, this
commit adds need_future_gp_mask() to compute the indexing mask from the
array size, need_future_gp_element() to access the element corresponding
to the specified grace-period number, and need_any_future_gp() to
determine if any future grace period is needed.  This commit also applies
need_future_gp_element() to existing open-coded single-element accesses.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Tested-by: Nicholas Piggin <npiggin@gmail.com>
kernel/rcu/tree.c
kernel/rcu/tree.h
kernel/rcu/tree_plugin.h