> > +#if DEBUG_AUGMENT_PROPAGATE_CHECK
> > +static void
> > +augment_tree_propagate_do_check(struct rb_node *n)
> > +{
> > +   struct vmap_area *va;
> > +   struct rb_node *node;
> > +   unsigned long size;
> > +   bool found = false;
> > +
> > +   if (n == NULL)
> > +           return;
> > +
> > +   va = rb_entry(n, struct vmap_area, rb_node);
> > +   size = va->subtree_max_size;
> > +   node = n;
> > +
> > +   while (node) {
> > +           va = rb_entry(node, struct vmap_area, rb_node);
> > +
> > +           if (get_subtree_max_size(node->rb_left) == size) {
> > +                   node = node->rb_left;
> > +           } else {
> > +                   if (__va_size(va) == size) {
> > +                           found = true;
> > +                           break;
> > +                   }
> > +
> > +                   node = node->rb_right;
> > +           }
> > +   }
> > +
> > +   if (!found) {
> > +           va = rb_entry(n, struct vmap_area, rb_node);
> > +           pr_emerg("tree is corrupted: %lu, %lu\n",
> > +                   __va_size(va), va->subtree_max_size);
> > +   }
> > +
> > +   augment_tree_propagate_do_check(n->rb_left);
> > +   augment_tree_propagate_do_check(n->rb_right);
> > +}
> > +
> > +static void augment_tree_propagate_from_check(void)
> 
> Why do you need this intermediate function?
> 
> Other than that looks good to me, please free to use
> Reviewed-by: Roman Gushchin <g...@fb.com>
> 
Will remove, we do not need that extra wrapper.

--
Vlad Rezki

Reply via email to