1 #ifndef __LINUX_SEQLOCK_H
2 #define __LINUX_SEQLOCK_H
4 #include <linux/compiler.h>
6 typedef struct seqcount {
10 static inline void seqcount_init(seqcount_t *s)
15 static inline unsigned read_seqcount_begin(const seqcount_t *s)
20 ret = READ_ONCE(s->sequence);
21 if (unlikely(ret & 1)) {
29 static inline int read_seqcount_retry(const seqcount_t *s, unsigned start)
32 return unlikely(s->sequence != start);
35 static inline void write_seqcount_begin(seqcount_t *s)
41 static inline void write_seqcount_end(seqcount_t *s)
47 #endif /* __LINUX_SEQLOCK_H */