Skip to contentSkip to conversation

block-backend: remove qatomic_mb_read()

PATCH In review Paolo Bonzini 2 participants 2 messages Apr 6, 2023 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block-backend: remove qatomic_mb_read()

There is already a barrier in AIO_WAIT_WHILE_INTERNAL(), thus the qatomic_mb_read() is not adding anything.

---
 block/block-backend.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
block/block-backend.c +2 -2
index 2ee39229e4cf..b6297aae6ad0 100644
@@ -1821,7 +1821,7 @@ void blk_drain(BlockBackend *blk)
 
     /* We may have -ENOMEDIUM completions in flight */
     AIO_WAIT_WHILE(blk_get_aio_context(blk),
-                   qatomic_mb_read(&blk->in_flight) > 0);
+                   qatomic_read(&blk->in_flight) > 0);
 
     if (bs) {
         bdrv_drained_end(bs);
@@ -1843,7 +1843,7 @@ void blk_drain_all(void)
         aio_context_acquire(ctx);
 
         /* We may have -ENOMEDIUM completions in flight */
-        AIO_WAIT_WHILE(ctx, qatomic_mb_read(&blk->in_flight) > 0);
+        AIO_WAIT_WHILE(ctx, qatomic_read(&blk->in_flight) > 0);
 
         aio_context_release(ctx);
     }
Signature · 1 line
2.39.2