[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 14/23] block/reqlist: reqlist_find_conflict(): use ranges_overlap(
From: |
Hanna Reitz |
Subject: |
[PULL 14/23] block/reqlist: reqlist_find_conflict(): use ranges_overlap() |
Date: |
Mon, 7 Mar 2022 11:35:40 +0100 |
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Let's reuse convenient helper.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220303194349.2304213-8-vsementsov@virtuozzo.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
---
block/reqlist.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/block/reqlist.c b/block/reqlist.c
index 5e320ba649..09fecbd48c 100644
--- a/block/reqlist.c
+++ b/block/reqlist.c
@@ -13,6 +13,7 @@
*/
#include "qemu/osdep.h"
+#include "qemu/range.h"
#include "block/reqlist.h"
@@ -35,7 +36,7 @@ BlockReq *reqlist_find_conflict(BlockReqList *reqs, int64_t
offset,
BlockReq *r;
QLIST_FOREACH(r, reqs, list) {
- if (offset + bytes > r->offset && offset < r->offset + r->bytes) {
+ if (ranges_overlap(offset, bytes, r->offset, r->bytes)) {
return r;
}
}
--
2.34.1
- [PULL 02/23] block/curl.c: Set error message string if curl_init_state() fails, (continued)
- [PULL 02/23] block/curl.c: Set error message string if curl_init_state() fails, Hanna Reitz, 2022/03/07
- [PULL 01/23] ide: Increment BB in-flight counter for TRIM BH, Hanna Reitz, 2022/03/07
- [PULL 03/23] block/curl.c: Check error return from curl_easy_setopt(), Hanna Reitz, 2022/03/07
- [PULL 05/23] tests/qemu-iotests/040: Skip TestCommitWithFilters without 'throttle', Hanna Reitz, 2022/03/07
- [PULL 07/23] iotests: Write test output to TEST_DIR, Hanna Reitz, 2022/03/07
- [PULL 10/23] block/block-copy: block_copy_state_new(): add bitmap parameter, Hanna Reitz, 2022/03/07
- [PULL 11/23] block/copy-before-write: add bitmap open parameter, Hanna Reitz, 2022/03/07
- [PULL 12/23] block/block-copy: add block_copy_reset(), Hanna Reitz, 2022/03/07
- [PULL 06/23] tests/qemu-iotests/testrunner: Quote "case not run" lines in TAP mode, Hanna Reitz, 2022/03/07
- [PULL 16/23] block/reqlist: add reqlist_wait_all(), Hanna Reitz, 2022/03/07
- [PULL 14/23] block/reqlist: reqlist_find_conflict(): use ranges_overlap(),
Hanna Reitz <=
- [PULL 09/23] block/dirty-bitmap: bdrv_merge_dirty_bitmap(): add return value, Hanna Reitz, 2022/03/07
- [PULL 19/23] block: copy-before-write: realize snapshot-access API, Hanna Reitz, 2022/03/07
- [PULL 13/23] block: intoduce reqlist, Hanna Reitz, 2022/03/07
- [PULL 15/23] block/dirty-bitmap: introduce bdrv_dirty_bitmap_status(), Hanna Reitz, 2022/03/07
- [PULL 23/23] iotests/image-fleecing: test push backup with fleecing, Hanna Reitz, 2022/03/07
- [PULL 22/23] iotests/image-fleecing: add test case with bitmap, Hanna Reitz, 2022/03/07
- [PULL 21/23] iotests.py: add qemu_io_pipe_and_status(), Hanna Reitz, 2022/03/07
- [PULL 18/23] block: introduce snapshot-access block driver, Hanna Reitz, 2022/03/07
- [PULL 20/23] iotests/image-fleecing: add test-case for fleecing format node, Hanna Reitz, 2022/03/07
- [PULL 17/23] block/io: introduce block driver snapshot-access API, Hanna Reitz, 2022/03/07