[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 08/30] block/io: bdrv_wait_serialising_requests_locked: drop extra
From: |
Max Reitz |
Subject: |
[PULL 08/30] block/io: bdrv_wait_serialising_requests_locked: drop extra bs arg |
Date: |
Fri, 18 Dec 2020 16:12:27 +0100 |
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
bs is linked in req, so no needs to pass it separately. Most of
tracked-requests API doesn't have bs argument. Actually, after this
patch only tracked_request_begin has it, but it's for purpose.
While being here, also add a comment about what "_locked" is.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20201021145859.11201-5-vsementsov@virtuozzo.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
block/io.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/block/io.c b/block/io.c
index 640136b8bc..d7015378a3 100644
--- a/block/io.c
+++ b/block/io.c
@@ -788,16 +788,16 @@ bdrv_find_conflicting_request(BdrvTrackedRequest *self)
return NULL;
}
+/* Called with self->bs->reqs_lock held */
static bool coroutine_fn
-bdrv_wait_serialising_requests_locked(BlockDriverState *bs,
- BdrvTrackedRequest *self)
+bdrv_wait_serialising_requests_locked(BdrvTrackedRequest *self)
{
BdrvTrackedRequest *req;
bool waited = false;
while ((req = bdrv_find_conflicting_request(self))) {
self->waiting_for = req;
- qemu_co_queue_wait(&req->wait_queue, &bs->reqs_lock);
+ qemu_co_queue_wait(&req->wait_queue, &self->bs->reqs_lock);
self->waiting_for = NULL;
waited = true;
}
@@ -821,7 +821,7 @@ bool bdrv_mark_request_serialising(BdrvTrackedRequest *req,
uint64_t align)
req->overlap_offset = MIN(req->overlap_offset, overlap_offset);
req->overlap_bytes = MAX(req->overlap_bytes, overlap_bytes);
- waited = bdrv_wait_serialising_requests_locked(bs, req);
+ waited = bdrv_wait_serialising_requests_locked(req);
qemu_co_mutex_unlock(&bs->reqs_lock);
return waited;
}
@@ -903,7 +903,7 @@ static bool coroutine_fn
bdrv_wait_serialising_requests(BdrvTrackedRequest *self
}
qemu_co_mutex_lock(&bs->reqs_lock);
- waited = bdrv_wait_serialising_requests_locked(bs, self);
+ waited = bdrv_wait_serialising_requests_locked(self);
qemu_co_mutex_unlock(&bs->reqs_lock);
return waited;
--
2.29.2
- [PULL 00/30] Block patches, Max Reitz, 2020/12/18
- [PULL 01/30] block: add bdrv_refresh_perms() helper, Max Reitz, 2020/12/18
- [PULL 03/30] block: bdrv_child_set_perm() drop redundant parameters., Max Reitz, 2020/12/18
- [PULL 02/30] block: bdrv_set_perm() drop redundant parameters., Max Reitz, 2020/12/18
- [PULL 04/30] block: drop tighten_restrictions, Max Reitz, 2020/12/18
- [PULL 06/30] block/io.c: drop assertion on double waiting for request serialisation, Max Reitz, 2020/12/18
- [PULL 07/30] block/io: split out bdrv_find_conflicting_request, Max Reitz, 2020/12/18
- [PULL 08/30] block/io: bdrv_wait_serialising_requests_locked: drop extra bs arg,
Max Reitz <=
- [PULL 09/30] block: bdrv_mark_request_serialising: split non-waiting function, Max Reitz, 2020/12/18
- [PULL 11/30] block: bdrv_check_perm(): process children anyway, Max Reitz, 2020/12/18
- [PULL 05/30] block: simplify comment to BDRV_REQ_SERIALISING, Max Reitz, 2020/12/18
- [PULL 10/30] block: introduce BDRV_REQ_NO_WAIT flag, Max Reitz, 2020/12/18
- [PULL 14/30] iotests: qemu_io_silent: support --image-opts, Max Reitz, 2020/12/18
- [PULL 13/30] qemu-io: add preallocate mode parameter for truncate command, Max Reitz, 2020/12/18
- [PULL 12/30] block: introduce preallocate filter, Max Reitz, 2020/12/18
- [PULL 15/30] iotests.py: execute_setup_common(): add required_fmts argument, Max Reitz, 2020/12/18
- [PULL 16/30] iotests: add 298 to test new preallocate filter driver, Max Reitz, 2020/12/18
- [PULL 19/30] scripts/simplebench: use standard deviation for +- error, Max Reitz, 2020/12/18