From 57840fed199a9e8e9ef94b44c851b68b7c096086 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Mon, 27 Jun 2022 14:45:48 -0400 Subject: [PATCH] Fixup from darray change This fixes cmd_migrate Signed-off-by: Kent Overstreet --- tools-util.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools-util.h b/tools-util.h index e9f0ce94..d1122f5d 100644 --- a/tools-util.h +++ b/tools-util.h @@ -95,7 +95,7 @@ static inline struct range hole_iter_next(struct hole_iter *iter) { struct range r = { .start = iter->idx ? iter->r.data[iter->idx - 1].end : 0, - .end = iter->idx < iter->r.size + .end = iter->idx < iter->r.nr ? iter->r.data[iter->idx].start : iter->end, }; @@ -107,7 +107,7 @@ static inline struct range hole_iter_next(struct hole_iter *iter) #define for_each_hole(_iter, _ranges, _end, _i) \ for (_iter = (struct hole_iter) { .r = _ranges, .end = _end }; \ - (_iter.idx <= _iter.r.size && \ + (_iter.idx <= _iter.r.nr && \ (_i = hole_iter_next(&_iter), true));) #include