struct interval_tree_span_iter - Find used and unused spans. @start_hole: Start of an interval for a hole when is_hole == 1 @last_hole: Inclusive end of an interval for a hole when is_hole == 1 @start_used: Start of a used interval when is_hole == 0 @last_used: Inclusive end of a used interval when is_hole == 0 @is_hole: 0 == used, 1 == is_hole, -1 == done iteration
This iterator travels over spans in an interval tree. It does not return nodes but classifies each span as either a hole, where no nodes intersect, or a used, which is fully covered by nodes. Each iteration step toggles between hole and used until the entire range is covered. The returned spans always fully cover the requested range.
The iterator is greedy, it always returns the largest hole or used possible, consolidating all consecutive nodes.
Use interval_tree_span_iter_done() to detect end of iteration.