55 lines
1.7 KiB
Diff
55 lines
1.7 KiB
Diff
|
|
From d82b2052d61cd57fb2ebf53f633cb0ff272d16c3 Mon Sep 17 00:00:00 2001
|
||
|
|
From: Wanghe Xiao <xiaowanghe_yewu@cmss.chinamobile.com>
|
||
|
|
Date: Sat, 25 Nov 2023 02:53:08 -0800
|
||
|
|
Subject: [PATCH] block: use 'unsigned' for in_flight field on driver state
|
||
|
|
|
||
|
|
cherry picked from commit 1b8f777673985af366de099ad4e41d334b36fb12
|
||
|
|
|
||
|
|
This patch makes in_flight field 'unsigned' for BDRVNBDState and
|
||
|
|
MirrorBlockJob. This matches the definition of this field on BDS
|
||
|
|
and is generically correct - we should never get negative value here.
|
||
|
|
|
||
|
|
Signed-off-by: Denis V. Lunev <den@openvz.org>
|
||
|
|
CC: John Snow <jsnow@redhat.com>
|
||
|
|
CC: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
|
||
|
|
CC: Kevin Wolf <kwolf@redhat.com>
|
||
|
|
CC: Hanna Reitz <hreitz@redhat.com>
|
||
|
|
CC: Eric Blake <eblake@redhat.com>
|
||
|
|
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
|
||
|
|
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
|
||
|
|
Signed-off-by: Wanghe Xiao <xiaowanghe_yewu@cmss.chinamobile.com>
|
||
|
|
---
|
||
|
|
block/mirror.c | 2 +-
|
||
|
|
block/nbd.c | 2 +-
|
||
|
|
2 files changed, 2 insertions(+), 2 deletions(-)
|
||
|
|
|
||
|
|
diff --git a/block/mirror.c b/block/mirror.c
|
||
|
|
index b7f0cba9b9..d1863565c4 100644
|
||
|
|
--- a/block/mirror.c
|
||
|
|
+++ b/block/mirror.c
|
||
|
|
@@ -72,7 +72,7 @@ typedef struct MirrorBlockJob {
|
||
|
|
|
||
|
|
uint64_t last_pause_ns;
|
||
|
|
unsigned long *in_flight_bitmap;
|
||
|
|
- int in_flight;
|
||
|
|
+ unsigned in_flight;
|
||
|
|
int64_t bytes_in_flight;
|
||
|
|
QTAILQ_HEAD(, MirrorOp) ops_in_flight;
|
||
|
|
int ret;
|
||
|
|
diff --git a/block/nbd.c b/block/nbd.c
|
||
|
|
index 33adfddc41..a543e68d2f 100644
|
||
|
|
--- a/block/nbd.c
|
||
|
|
+++ b/block/nbd.c
|
||
|
|
@@ -76,7 +76,7 @@ typedef struct BDRVNBDState {
|
||
|
|
CoQueue free_sema;
|
||
|
|
|
||
|
|
CoMutex receive_mutex;
|
||
|
|
- int in_flight;
|
||
|
|
+ unsigned in_flight;
|
||
|
|
NBDClientState state;
|
||
|
|
|
||
|
|
QEMUTimer *reconnect_delay_timer;
|
||
|
|
--
|
||
|
|
2.27.0
|
||
|
|
|