Lines Matching defs:seqcount
41 struct seqcount {
45 typedef struct seqcount seqcount_t;
48 seqcount_init(struct seqcount *seqcount)
51 seqcount->sqc_gen = 0;
55 seqcount_destroy(struct seqcount *seqcount)
58 KASSERT((seqcount->sqc_gen & 1) == 0);
59 seqcount->sqc_gen = -1;
63 write_seqcount_begin(struct seqcount *seqcount)
66 KASSERT((seqcount->sqc_gen & 1) == 0);
67 seqcount->sqc_gen |= 1;
72 write_seqcount_end(struct seqcount *seqcount)
75 KASSERT((seqcount->sqc_gen & 1) == 1);
77 seqcount->sqc_gen |= 1; /* paranoia */
78 seqcount->sqc_gen++;
82 __read_seqcount_begin(const struct seqcount *seqcount)
86 while (__predict_false((gen = seqcount->sqc_gen) & 1))
94 __read_seqcount_retry(const struct seqcount *seqcount, unsigned gen)
98 return __predict_false(seqcount->sqc_gen != gen);
102 read_seqcount_begin(const struct seqcount *seqcount)
106 gen = __read_seqcount_begin(seqcount);
113 read_seqcount_retry(const struct seqcount *seqcount, unsigned gen)
117 return __read_seqcount_retry(seqcount, gen);
121 raw_read_seqcount(const struct seqcount *seqcount)
125 gen = seqcount->sqc_gen;
133 struct seqcount sql_count;