|
@@ -815,27 +815,10 @@ static int dbg_find_check_orphan(struct rb_root *root, ino_t inum)
|
|
|
|
|
|
static void dbg_free_check_tree(struct rb_root *root)
|
|
static void dbg_free_check_tree(struct rb_root *root)
|
|
{
|
|
{
|
|
- struct rb_node *this = root->rb_node;
|
|
|
|
- struct check_orphan *o;
|
|
|
|
|
|
+ struct check_orphan *o, *n;
|
|
|
|
|
|
- while (this) {
|
|
|
|
- if (this->rb_left) {
|
|
|
|
- this = this->rb_left;
|
|
|
|
- continue;
|
|
|
|
- } else if (this->rb_right) {
|
|
|
|
- this = this->rb_right;
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
- o = rb_entry(this, struct check_orphan, rb);
|
|
|
|
- this = rb_parent(this);
|
|
|
|
- if (this) {
|
|
|
|
- if (this->rb_left == &o->rb)
|
|
|
|
- this->rb_left = NULL;
|
|
|
|
- else
|
|
|
|
- this->rb_right = NULL;
|
|
|
|
- }
|
|
|
|
|
|
+ rbtree_postorder_for_each_entry_safe(o, n, root, rb)
|
|
kfree(o);
|
|
kfree(o);
|
|
- }
|
|
|
|
}
|
|
}
|
|
|
|
|
|
static int dbg_orphan_check(struct ubifs_info *c, struct ubifs_zbranch *zbr,
|
|
static int dbg_orphan_check(struct ubifs_info *c, struct ubifs_zbranch *zbr,
|