|
@@ -296,13 +296,14 @@ static inline void *__ptr_ring_consume(struct ptr_ring *r)
|
|
{
|
|
{
|
|
void *ptr;
|
|
void *ptr;
|
|
|
|
|
|
|
|
+ /* The READ_ONCE in __ptr_ring_peek guarantees that anyone
|
|
|
|
+ * accessing data through the pointer is up to date. Pairs
|
|
|
|
+ * with smp_wmb in __ptr_ring_produce.
|
|
|
|
+ */
|
|
ptr = __ptr_ring_peek(r);
|
|
ptr = __ptr_ring_peek(r);
|
|
if (ptr)
|
|
if (ptr)
|
|
__ptr_ring_discard_one(r);
|
|
__ptr_ring_discard_one(r);
|
|
|
|
|
|
- /* Make sure anyone accessing data through the pointer is up to date. */
|
|
|
|
- /* Pairs with smp_wmb in __ptr_ring_produce. */
|
|
|
|
- smp_read_barrier_depends();
|
|
|
|
return ptr;
|
|
return ptr;
|
|
}
|
|
}
|
|
|
|
|