diff mbox series

[13/13] block: Remove poll parameter from bdrv_parent_drained_begin_single()

Message ID 20221108123738.530873-14-kwolf@redhat.com
State New
Headers show
Series block: Simplify drain | expand

Commit Message

Kevin Wolf Nov. 8, 2022, 12:37 p.m. UTC
All callers of bdrv_parent_drained_begin_single() pass poll=false now,
so we don't need the parameter any more.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 include/block/block-io.h | 5 ++---
 block.c                  | 4 ++--
 block/io.c               | 7 ++-----
 3 files changed, 6 insertions(+), 10 deletions(-)

Comments

Hanna Czenczek Nov. 14, 2022, 8:24 p.m. UTC | #1
On 08.11.22 13:37, Kevin Wolf wrote:
> All callers of bdrv_parent_drained_begin_single() pass poll=false now,
> so we don't need the parameter any more.
>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>   include/block/block-io.h | 5 ++---
>   block.c                  | 4 ++--
>   block/io.c               | 7 ++-----
>   3 files changed, 6 insertions(+), 10 deletions(-)

Well, “drained_begin” does not mean “drain”, so...

Reviewed-by: Hanna Reitz <hreitz@redhat.com>
diff mbox series

Patch

diff --git a/include/block/block-io.h b/include/block/block-io.h
index ddce8550a9..35669f0e62 100644
--- a/include/block/block-io.h
+++ b/include/block/block-io.h
@@ -285,10 +285,9 @@  bdrv_writev_vmstate(BlockDriverState *bs, QEMUIOVector *qiov, int64_t pos);
 /**
  * bdrv_parent_drained_begin_single:
  *
- * Begin a quiesced section for the parent of @c. If @poll is true, wait for
- * any pending activity to cease.
+ * Begin a quiesced section for the parent of @c.
  */
-void bdrv_parent_drained_begin_single(BdrvChild *c, bool poll);
+void bdrv_parent_drained_begin_single(BdrvChild *c);
 
 /**
  * bdrv_parent_drained_poll_single:
diff --git a/block.c b/block.c
index 12039e9b8a..c200f7afa0 100644
--- a/block.c
+++ b/block.c
@@ -2409,7 +2409,7 @@  static void bdrv_replace_child_abort(void *opaque)
          * new_bs drained when calling bdrv_replace_child_tran() is not a
          * requirement any more.
          */
-        bdrv_parent_drained_begin_single(s->child, false);
+        bdrv_parent_drained_begin_single(s->child);
         assert(!bdrv_parent_drained_poll_single(s->child));
     }
     assert(s->child->parent_quiesce_counter);
@@ -3016,7 +3016,7 @@  static BdrvChild *bdrv_attach_child_common(BlockDriverState *child_bs,
      * bdrv_replace_child_noperm() will undrain it if the child node is not
      * drained. The child was only just created, so polling is not necessary.
      */
-    bdrv_parent_drained_begin_single(new_child, false);
+    bdrv_parent_drained_begin_single(new_child);
     bdrv_replace_child_noperm(new_child, child_bs);
 
     BdrvAttachChildCommonState *s = g_new(BdrvAttachChildCommonState, 1);
diff --git a/block/io.c b/block/io.c
index d0f641926f..9bcb19e5ee 100644
--- a/block/io.c
+++ b/block/io.c
@@ -53,7 +53,7 @@  static void bdrv_parent_drained_begin(BlockDriverState *bs, BdrvChild *ignore)
         if (c == ignore) {
             continue;
         }
-        bdrv_parent_drained_begin_single(c, false);
+        bdrv_parent_drained_begin_single(c);
     }
 }
 
@@ -103,7 +103,7 @@  static bool bdrv_parent_drained_poll(BlockDriverState *bs, BdrvChild *ignore)
     return busy;
 }
 
-void bdrv_parent_drained_begin_single(BdrvChild *c, bool poll)
+void bdrv_parent_drained_begin_single(BdrvChild *c)
 {
     IO_OR_GS_CODE();
     assert(c->parent_quiesce_counter == 0);
@@ -111,9 +111,6 @@  void bdrv_parent_drained_begin_single(BdrvChild *c, bool poll)
     if (c->klass->drained_begin) {
         c->klass->drained_begin(c);
     }
-    if (poll) {
-        BDRV_POLL_WHILE(c->bs, bdrv_parent_drained_poll_single(c));
-    }
 }
 
 static void bdrv_merge_limits(BlockLimits *dst, const BlockLimits *src)