thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone

Blame SOURCES/kvm-block-backend-Make-blk_inc-dec_in_flight-public.patch

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