diff --git a/sys/compat/linuxkpi/common/include/linux/seqlock.h b/sys/compat/linuxkpi/common/include/linux/seqlock.h --- a/sys/compat/linuxkpi/common/include/linux/seqlock.h +++ b/sys/compat/linuxkpi/common/include/linux/seqlock.h @@ -36,6 +36,8 @@ #include #include +#include + struct lock_class_key; struct seqcount { @@ -84,6 +86,13 @@ struct seqcount_mutex: seqc_write_end \ )(&(s)->seqc) +static inline void +write_seqcount_invalidate(struct seqcount_mutex *seqcount) +{ + atomic_thread_fence_rel(); + seqcount->seqc += 2; +} + #define read_seqcount_begin(s) seqc_read(&(s)->seqc) #define raw_read_seqcount(s) seqc_read_any(&(s)->seqc) @@ -165,4 +174,10 @@ #define read_seqretry(seqlock, gen) \ read_seqcount_retry(&(seqlock)->seql_count, gen) +static inline unsigned +seqprop_sequence(const seqcount_mutex_t *seqcount) +{ + return READ_ONCE(seqcount->seqc); +} + #endif /* _LINUXKPI_LINUX_SEQLOCK_H__ */