Skip to content

Commit 4439711

Browse files
paulmckrcufbq
authored andcommitted
srcu: Move SRCU Tree/Tiny definitions from srcu.h
There are a couple of definitions under "#ifdef CONFIG_TINY_SRCU" in include/linux/srcu.h. There is no point in them being there, so this commit moves them to include/linux/srcutiny.h and include/linux/srcutree.c, thus eliminating that #ifdef. Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Cc: Alexei Starovoitov <ast@kernel.org> Cc: Andrii Nakryiko <andrii@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Kent Overstreet <kent.overstreet@linux.dev> Cc: <bpf@vger.kernel.org> Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
1 parent 4937096 commit 4439711

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

include/linux/srcu.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ int init_srcu_struct(struct srcu_struct *ssp);
5252
#define SRCU_READ_FLAVOR_SLOWGP SRCU_READ_FLAVOR_LITE
5353
// Flavors requiring synchronize_rcu()
5454
// instead of smp_mb().
55+
void __srcu_read_unlock(struct srcu_struct *ssp, int idx) __releases(ssp);
5556

5657
#ifdef CONFIG_TINY_SRCU
5758
#include <linux/srcutiny.h>
@@ -64,15 +65,6 @@ int init_srcu_struct(struct srcu_struct *ssp);
6465
void call_srcu(struct srcu_struct *ssp, struct rcu_head *head,
6566
void (*func)(struct rcu_head *head));
6667
void cleanup_srcu_struct(struct srcu_struct *ssp);
67-
int __srcu_read_lock(struct srcu_struct *ssp) __acquires(ssp);
68-
void __srcu_read_unlock(struct srcu_struct *ssp, int idx) __releases(ssp);
69-
#ifdef CONFIG_TINY_SRCU
70-
#define __srcu_read_lock_lite __srcu_read_lock
71-
#define __srcu_read_unlock_lite __srcu_read_unlock
72-
#else // #ifdef CONFIG_TINY_SRCU
73-
int __srcu_read_lock_lite(struct srcu_struct *ssp) __acquires(ssp);
74-
void __srcu_read_unlock_lite(struct srcu_struct *ssp, int idx) __releases(ssp);
75-
#endif // #else // #ifdef CONFIG_TINY_SRCU
7668
void synchronize_srcu(struct srcu_struct *ssp);
7769

7870
#define SRCU_GET_STATE_COMPLETED 0x1

include/linux/srcutiny.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ static inline int __srcu_read_lock(struct srcu_struct *ssp)
7171
return idx;
7272
}
7373

74+
#define __srcu_read_lock_lite __srcu_read_lock
75+
#define __srcu_read_unlock_lite __srcu_read_unlock
76+
7477
static inline void synchronize_srcu_expedited(struct srcu_struct *ssp)
7578
{
7679
synchronize_srcu(ssp);

include/linux/srcutree.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ struct srcu_struct {
207207
#define DEFINE_SRCU(name) __DEFINE_SRCU(name, /* not static */)
208208
#define DEFINE_STATIC_SRCU(name) __DEFINE_SRCU(name, static)
209209

210+
int __srcu_read_lock(struct srcu_struct *ssp) __acquires(ssp);
210211
void synchronize_srcu_expedited(struct srcu_struct *ssp);
211212
void srcu_barrier(struct srcu_struct *ssp);
212213
void srcu_torture_stats_print(struct srcu_struct *ssp, char *tt, char *tf);

0 commit comments

Comments
 (0)