|
|
7711c0 |
From fe68ddea8e2283fad78a3596ee0682d49294987f Mon Sep 17 00:00:00 2001
|
|
|
7711c0 |
From: Kevin Wolf <kwolf@redhat.com>
|
|
|
7711c0 |
Date: Fri, 1 Mar 2019 14:27:43 +0100
|
|
|
7711c0 |
Subject: [PATCH 1/9] block-backend: Make blk_inc/dec_in_flight public
|
|
|
7711c0 |
|
|
|
7711c0 |
RH-Author: Kevin Wolf <kwolf@redhat.com>
|
|
|
7711c0 |
Message-id: <20190301142747.12251-2-kwolf@redhat.com>
|
|
|
7711c0 |
Patchwork-id: 84764
|
|
|
7711c0 |
O-Subject: [RHEL-7.7 qemu-kvm-rhev PATCH 1/5] block-backend: Make blk_inc/dec_in_flight public
|
|
|
7711c0 |
Bugzilla: 1671173
|
|
|
7711c0 |
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
7711c0 |
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
7711c0 |
RH-Acked-by: John Snow <jsnow@redhat.com>
|
|
|
7711c0 |
|
|
|
7711c0 |
For some users of BlockBackends, just increasing the in_flight counter
|
|
|
7711c0 |
is easier than implementing separate handlers in BlockDevOps. Make the
|
|
|
7711c0 |
helper functions for this public.
|
|
|
7711c0 |
|
|
|
7711c0 |
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
7711c0 |
(cherry picked from commit c90e2a9cfd94bd02d92c53b97f04fd595001de7e)
|
|
|
7711c0 |
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
7711c0 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
7711c0 |
---
|
|
|
7711c0 |
block/block-backend.c | 4 ++--
|
|
|
7711c0 |
include/sysemu/block-backend.h | 2 ++
|
|
|
7711c0 |
2 files changed, 4 insertions(+), 2 deletions(-)
|
|
|
7711c0 |
|
|
|
7711c0 |
diff --git a/block/block-backend.c b/block/block-backend.c
|
|
|
7711c0 |
index ddec869..52eebeb 100644
|
|
|
7711c0 |
--- a/block/block-backend.c
|
|
|
7711c0 |
+++ b/block/block-backend.c
|
|
|
7711c0 |
@@ -1294,12 +1294,12 @@ int blk_make_zero(BlockBackend *blk, BdrvRequestFlags flags)
|
|
|
7711c0 |
return bdrv_make_zero(blk->root, flags);
|
|
|
7711c0 |
}
|
|
|
7711c0 |
|
|
|
7711c0 |
-static void blk_inc_in_flight(BlockBackend *blk)
|
|
|
7711c0 |
+void blk_inc_in_flight(BlockBackend *blk)
|
|
|
7711c0 |
{
|
|
|
7711c0 |
atomic_inc(&blk->in_flight);
|
|
|
7711c0 |
}
|
|
|
7711c0 |
|
|
|
7711c0 |
-static void blk_dec_in_flight(BlockBackend *blk)
|
|
|
7711c0 |
+void blk_dec_in_flight(BlockBackend *blk)
|
|
|
7711c0 |
{
|
|
|
7711c0 |
atomic_dec(&blk->in_flight);
|
|
|
7711c0 |
aio_wait_kick();
|
|
|
7711c0 |
diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h
|
|
|
7711c0 |
index 830d873..6b6d882 100644
|
|
|
7711c0 |
--- a/include/sysemu/block-backend.h
|
|
|
7711c0 |
+++ b/include/sysemu/block-backend.h
|
|
|
7711c0 |
@@ -157,6 +157,8 @@ int blk_co_pdiscard(BlockBackend *blk, int64_t offset, int bytes);
|
|
|
7711c0 |
int blk_co_flush(BlockBackend *blk);
|
|
|
7711c0 |
int blk_flush(BlockBackend *blk);
|
|
|
7711c0 |
int blk_commit_all(void);
|
|
|
7711c0 |
+void blk_inc_in_flight(BlockBackend *blk);
|
|
|
7711c0 |
+void blk_dec_in_flight(BlockBackend *blk);
|
|
|
7711c0 |
void blk_drain(BlockBackend *blk);
|
|
|
7711c0 |
void blk_drain_all(void);
|
|
|
7711c0 |
void blk_set_on_error(BlockBackend *blk, BlockdevOnError on_read_error,
|
|
|
7711c0 |
--
|
|
|
7711c0 |
1.8.3.1
|
|
|
7711c0 |
|