To be used in the next commit.
Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]>
---
include/block/reqlist.h | 2 ++
block/reqlist.c | 6 ++++++
2 files changed, 8 insertions(+)
diff --git a/include/block/reqlist.h b/include/block/reqlist.h
index 2de86be300..59d5c24cda 100644
--- a/include/block/reqlist.h
+++ b/include/block/reqlist.h
@@ -39,6 +39,8 @@ BlockReq *reqlist_find_conflict(BlockReqList *reqs, int64_t
offset,
int64_t bytes);
bool coroutine_fn reqlist_wait_one(BlockReqList *reqs, int64_t offset,
int64_t bytes, CoMutex *lock);
+void coroutine_fn reqlist_wait_all(BlockReqList *reqs, int64_t offset,
+ int64_t bytes, CoMutex *lock);
void coroutine_fn reqlist_shrink_req(BlockReq *req, int64_t new_bytes);
void coroutine_fn reqlist_remove_req(BlockReq *req);
diff --git a/block/reqlist.c b/block/reqlist.c
index c41415c16a..939437621d 100644
--- a/block/reqlist.c
+++ b/block/reqlist.c
@@ -68,6 +68,12 @@ bool coroutine_fn reqlist_wait_one(BlockReqList *reqs,
int64_t offset,
return true;
}
+void coroutine_fn reqlist_wait_all(BlockReqList *reqs, int64_t offset,
+ int64_t bytes, CoMutex *lock)
+{
+ while (reqlist_wait_one(reqs, offset, bytes, lock)) { }
+}
+
/*
* Shrink request and wake all waiting coroutines (may be some of them are not
* intersecting with shrunk request).
--
2.29.2