mirror of https://github.com/xemu-project/xemu.git
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:
parent
d088e6a48a
commit
84b1e80f67
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue