2020-11-13 22:41:06 +03:00
|
|
|
#ifndef __TOOLS_LINUX_SRCU_H
|
|
|
|
#define __TOOLS_LINUX_SRCU_H
|
|
|
|
|
2024-08-23 22:38:12 +03:00
|
|
|
#include <linux/rcupdate.h>
|
|
|
|
|
|
|
|
#define NUM_ACTIVE_RCU_POLL_OLDSTATE 2
|
|
|
|
|
|
|
|
typedef void (*rcu_callback_t)(struct rcu_head *head);
|
|
|
|
|
2024-12-04 05:33:02 +03:00
|
|
|
static inline struct urcu_gp_poll_state get_state_synchronize_rcu()
|
|
|
|
{
|
|
|
|
return start_poll_synchronize_rcu();
|
|
|
|
}
|
|
|
|
|
2020-11-13 22:41:06 +03:00
|
|
|
struct srcu_struct {
|
|
|
|
};
|
|
|
|
|
|
|
|
static inline void srcu_read_unlock(struct srcu_struct *ssp, int idx) {}
|
|
|
|
|
|
|
|
static inline int srcu_read_lock(struct srcu_struct *ssp)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2024-12-04 05:33:02 +03:00
|
|
|
static inline bool poll_state_synchronize_srcu(struct srcu_struct *ssp, struct urcu_gp_poll_state cookie)
|
2024-08-23 22:38:12 +03:00
|
|
|
{
|
2024-12-04 05:33:02 +03:00
|
|
|
return poll_state_synchronize_rcu(cookie);
|
2024-08-23 22:38:12 +03:00
|
|
|
}
|
|
|
|
|
2024-12-04 05:33:02 +03:00
|
|
|
static inline struct urcu_gp_poll_state start_poll_synchronize_srcu(struct srcu_struct *ssp)
|
2024-08-23 22:38:12 +03:00
|
|
|
{
|
2024-12-04 05:33:02 +03:00
|
|
|
return start_poll_synchronize_rcu();
|
2024-08-23 22:38:12 +03:00
|
|
|
}
|
|
|
|
|
2024-12-04 05:33:02 +03:00
|
|
|
static inline struct urcu_gp_poll_state get_state_synchronize_srcu(struct srcu_struct *ssp)
|
2024-08-23 22:38:12 +03:00
|
|
|
{
|
2024-12-04 05:33:02 +03:00
|
|
|
return get_state_synchronize_rcu();
|
2024-08-23 22:38:12 +03:00
|
|
|
}
|
|
|
|
|
2024-06-17 18:31:26 +03:00
|
|
|
static inline void synchronize_srcu_expedited(struct srcu_struct *ssp) {}
|
|
|
|
|
2024-08-23 22:38:12 +03:00
|
|
|
static inline void srcu_barrier(struct srcu_struct *ssp) {}
|
|
|
|
|
2020-11-13 22:41:06 +03:00
|
|
|
static inline void cleanup_srcu_struct(struct srcu_struct *ssp) {}
|
|
|
|
|
2024-08-23 22:38:12 +03:00
|
|
|
static inline void call_srcu(struct srcu_struct *ssp, struct rcu_head *rhp,
|
|
|
|
rcu_callback_t func)
|
|
|
|
{
|
2024-09-22 08:13:01 +03:00
|
|
|
call_rcu(rhp, func);
|
2024-08-23 22:38:12 +03:00
|
|
|
}
|
|
|
|
|
2020-11-13 22:41:06 +03:00
|
|
|
static inline int init_srcu_struct(struct srcu_struct *ssp)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* __TOOLS_LINUX_SRCU_H */
|