+static bool min_iqs_available(size_t min_iqs, const struct btr_node *btrn)
+{
+ struct btr_buffer_reference *br;
+ size_t have = 0, wrap_consumed = 0;
+
+ FOR_EACH_BUFFER_REF(br, btrn) {
+ if (br->wrap_count != 0) {
+ wrap_consumed = br->consumed;
+ continue;
+ }
+ have += br_available_bytes(br);
+ if (have > wrap_consumed + min_iqs)
+ return true;
+ }
+ return false;
+}