Use atomic_load_acquire() and atomic_store_release() instead of barriers
where appropriate.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
+ seq = atomic_load_acquire(&s->sequence);
if (!(seq & 1))
break;
nop;
} while (1);
if (!(seq & 1))
break;
nop;
} while (1);
static inline void write_seqlock_begin(struct seqlock *s)
{
static inline void write_seqlock_begin(struct seqlock *s)
{
- s->sequence++;
- write_barrier();
+ s->sequence = atomic_load_acquire(&s->sequence) + 1;
}
static inline void write_seqlock_end(struct seqlock *s)
{
}
static inline void write_seqlock_end(struct seqlock *s)
{
- write_barrier();
- s->sequence++;
+ atomic_store_release(&s->sequence, s->sequence + 1);