block/reqlist: reqlist_find_conflict(): use ranges_overlap()

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>
This commit is contained in:
Vladimir Sementsov-Ogievskiy 2022-03-03 20:43:40 +01:00 committed by Hanna Reitz
parent d088e6a48a
commit 84b1e80f67
1 changed files with 2 additions and 1 deletions

View File

@ -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;
}
}