]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - include/linux/atomic.h
Update bcachefs sources to 783085c3cc44 kbuild: Allow gcov to be enabled on the comma...
[bcachefs-tools-debian] / include / linux / atomic.h
index 2c983cd4efb871822a0ef5652235759d3bcb4b86..7effc1612683eff6cd2b4c70c6ec4d7c67a3c675 100644 (file)
@@ -161,6 +161,13 @@ static inline i_type a_type##_read(const a_type##_t *v)                    \
        return __ATOMIC_READ(&v->counter);                              \
 }                                                                      \
                                                                        \
+static inline i_type a_type##_read_acquire(const a_type##_t *v)                \
+{                                                                      \
+       i_type ret = __ATOMIC_READ(&v->counter);                        \
+       smp_mb__after_atomic();                                         \
+       return ret;                                                     \
+}                                                                      \
+                                                                       \
 static inline void a_type##_set(a_type##_t *v, i_type i)               \
 {                                                                      \
        return __ATOMIC_SET(&v->counter, i);                            \