[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 4/9] block/io: bdrv_wait_serialising_requests_locked: drop ext
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[PATCH v2 4/9] block/io: bdrv_wait_serialising_requests_locked: drop extra bs arg |
Date: |
Fri, 14 Aug 2020 16:03:43 +0300 |
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>
---
block/io.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/block/io.c b/block/io.c
index 5b96715058..36bbe4b9b1 100644
--- a/block/io.c
+++ b/block/io.c
@@ -761,16 +761,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;
}
@@ -794,7 +794,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;
}
@@ -876,7 +876,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.21.3
- [PATCH v2 0/9] preallocate filter, Vladimir Sementsov-Ogievskiy, 2020/08/14
- [PATCH v2 2/9] block/io.c: drop assertion on double waiting for request serialisation, Vladimir Sementsov-Ogievskiy, 2020/08/14
- [PATCH v2 3/9] block/io: split out bdrv_find_conflicting_request, Vladimir Sementsov-Ogievskiy, 2020/08/14
- [PATCH v2 4/9] block/io: bdrv_wait_serialising_requests_locked: drop extra bs arg,
Vladimir Sementsov-Ogievskiy <=
- [PATCH v2 5/9] block: bdrv_mark_request_serialising: split non-waiting function, Vladimir Sementsov-Ogievskiy, 2020/08/14
- [PATCH v2 1/9] block: simplify comment to BDRV_REQ_SERIALISING, Vladimir Sementsov-Ogievskiy, 2020/08/14
- [PATCH v2 6/9] block: introduce BDRV_REQ_NO_WAIT flag, Vladimir Sementsov-Ogievskiy, 2020/08/14
- [PATCH v2 7/9] block: introduce preallocate filter, Vladimir Sementsov-Ogievskiy, 2020/08/14
- [PATCH v2 8/9] iotests.py: add verify_o_direct helper, Vladimir Sementsov-Ogievskiy, 2020/08/14
- [PATCH v2 9/9] iotests: add 298 to test new preallocate filter driver, Vladimir Sementsov-Ogievskiy, 2020/08/14
- Re: [PATCH v2 0/9] preallocate filter, no-reply, 2020/08/14
- Re: [PATCH v2 0/9] preallocate filter, no-reply, 2020/08/14
- DROP Re: [PATCH v2 0/9] preallocate filter, Vladimir Sementsov-Ogievskiy, 2020/08/14