1 // SPDX-License-Identifier: GPL-2.0
10 #include <sys/types.h>
12 #include "int_typedefs.h"
20 #include "workqueues.h"
22 #include <linux/srcu.h>
24 /* Functions needed from modify_srcu.c */
25 bool try_check_zero(struct srcu_struct *sp, int idx, int trycount);
26 void srcu_flip(struct srcu_struct *sp);
28 /* Simpler implementation of synchronize_srcu that ignores batching. */
29 void synchronize_srcu(struct srcu_struct *sp)
33 * This code assumes that try_check_zero will succeed anyway,
34 * so there is no point in multiple tries.
36 const int trycount = 1;
40 /* Ignore the lock, as multiple writers aren't working yet anyway. */
42 idx = 1 ^ (sp->completed & 1);
44 /* For comments see srcu_advance_batches. */
46 assume(try_check_zero(sp, idx, trycount));
50 assume(try_check_zero(sp, idx^1, trycount));