|
|
4ec855 |
From 0e5a55b3556fdd23bbeeaca40a151e7062d42c1e Mon Sep 17 00:00:00 2001
|
|
|
4ec855 |
From: Kevin Wolf <kwolf@redhat.com>
|
|
|
4ec855 |
Date: Wed, 14 Aug 2019 08:42:25 +0100
|
|
|
4ec855 |
Subject: [PATCH 02/10] block-backend: Make blk_inc/dec_in_flight public
|
|
|
4ec855 |
|
|
|
4ec855 |
RH-Author: Kevin Wolf <kwolf@redhat.com>
|
|
|
4ec855 |
Message-id: <20190814084229.6458-2-kwolf@redhat.com>
|
|
|
4ec855 |
Patchwork-id: 89966
|
|
|
4ec855 |
O-Subject: [RHEL-8.1.0 qemu-kvm PATCH 1/5] block-backend: Make blk_inc/dec_in_flight public
|
|
|
4ec855 |
Bugzilla: 1716349
|
|
|
4ec855 |
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
4ec855 |
RH-Acked-by: Max Reitz <mreitz@redhat.com>
|
|
|
4ec855 |
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
4ec855 |
|
|
|
4ec855 |
For some users of BlockBackends, just increasing the in_flight counter
|
|
|
4ec855 |
is easier than implementing separate handlers in BlockDevOps. Make the
|
|
|
4ec855 |
helper functions for this public.
|
|
|
4ec855 |
|
|
|
4ec855 |
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
4ec855 |
(cherry picked from commit c90e2a9cfd94bd02d92c53b97f04fd595001de7e)
|
|
|
4ec855 |
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
4ec855 |
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
|
|
|
4ec855 |
---
|
|
|
4ec855 |
block/block-backend.c | 4 ++--
|
|
|
4ec855 |
include/sysemu/block-backend.h | 2 ++
|
|
|
4ec855 |
2 files changed, 4 insertions(+), 2 deletions(-)
|
|
|
4ec855 |
|
|
|
4ec855 |
diff --git a/block/block-backend.c b/block/block-backend.c
|
|
|
4ec855 |
index 0d623e4..e941520 100644
|
|
|
4ec855 |
--- a/block/block-backend.c
|
|
|
4ec855 |
+++ b/block/block-backend.c
|
|
|
4ec855 |
@@ -1294,12 +1294,12 @@ int blk_make_zero(BlockBackend *blk, BdrvRequestFlags flags)
|
|
|
4ec855 |
return bdrv_make_zero(blk->root, flags);
|
|
|
4ec855 |
}
|
|
|
4ec855 |
|
|
|
4ec855 |
-static void blk_inc_in_flight(BlockBackend *blk)
|
|
|
4ec855 |
+void blk_inc_in_flight(BlockBackend *blk)
|
|
|
4ec855 |
{
|
|
|
4ec855 |
atomic_inc(&blk->in_flight);
|
|
|
4ec855 |
}
|
|
|
4ec855 |
|
|
|
4ec855 |
-static void blk_dec_in_flight(BlockBackend *blk)
|
|
|
4ec855 |
+void blk_dec_in_flight(BlockBackend *blk)
|
|
|
4ec855 |
{
|
|
|
4ec855 |
atomic_dec(&blk->in_flight);
|
|
|
4ec855 |
aio_wait_kick();
|
|
|
4ec855 |
diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h
|
|
|
4ec855 |
index 20f8bbb..815b6e5 100644
|
|
|
4ec855 |
--- a/include/sysemu/block-backend.h
|
|
|
4ec855 |
+++ b/include/sysemu/block-backend.h
|
|
|
4ec855 |
@@ -157,6 +157,8 @@ int blk_co_pdiscard(BlockBackend *blk, int64_t offset, int bytes);
|
|
|
4ec855 |
int blk_co_flush(BlockBackend *blk);
|
|
|
4ec855 |
int blk_flush(BlockBackend *blk);
|
|
|
4ec855 |
int blk_commit_all(void);
|
|
|
4ec855 |
+void blk_inc_in_flight(BlockBackend *blk);
|
|
|
4ec855 |
+void blk_dec_in_flight(BlockBackend *blk);
|
|
|
4ec855 |
void blk_drain(BlockBackend *blk);
|
|
|
4ec855 |
void blk_drain_all(void);
|
|
|
4ec855 |
void blk_set_on_error(BlockBackend *blk, BlockdevOnError on_read_error,
|
|
|
4ec855 |
--
|
|
|
4ec855 |
1.8.3.1
|
|
|
4ec855 |
|