mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-28 11:49:32 +00:00
rcu: Simplify rcutorture_get_gp_data()
This commit restructures rcutorture_get_gp_data() to take advantage of the fact that there is only one flavor of RCU. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
This commit is contained in:
parent
b97d23c51c
commit
f7dd7d44fd
1 changed files with 2 additions and 7 deletions
|
@ -597,21 +597,16 @@ EXPORT_SYMBOL_GPL(show_rcu_gp_kthreads);
|
|||
void rcutorture_get_gp_data(enum rcutorture_type test_type, int *flags,
|
||||
unsigned long *gp_seq)
|
||||
{
|
||||
struct rcu_state *rsp = NULL;
|
||||
|
||||
switch (test_type) {
|
||||
case RCU_FLAVOR:
|
||||
case RCU_BH_FLAVOR:
|
||||
case RCU_SCHED_FLAVOR:
|
||||
rsp = &rcu_state;
|
||||
*flags = READ_ONCE(rcu_state.gp_flags);
|
||||
*gp_seq = rcu_seq_current(&rcu_state.gp_seq);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (rsp == NULL)
|
||||
return;
|
||||
*flags = READ_ONCE(rsp->gp_flags);
|
||||
*gp_seq = rcu_seq_current(&rsp->gp_seq);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(rcutorture_get_gp_data);
|
||||
|
||||
|
|
Loading…
Reference in a new issue