/* add_ino - add an entry to the size tree.  */
static int add_ino(struct ubifs_info *c, ino_t inum, loff_t i_size, loff_t d_size, int exists)
/* add_ino - add an entry to the size tree.  */
static int add_ino(struct ubifs_info *c, ino_t inum, loff_t i_size, loff_t d_size, int exists)
{
	struct rb_node **p = &c->size_tree.rb_node, *parent = NULL;
	struct size_entry *e;
	while (*p) {
		parent = *p;
		e = rb_entry(parent, struct size_entry, rb);
		if (inum < e->inum)
			p = &(*p)->rb_left;
		else
			p = &(*p)->rb_right;
	}
	e = kzalloc(sizeof(struct size_entry), GFP_KERNEL);
	if (!e)
		return -ENOMEM;
	e->inum = inum;
	e->i_size = i_size;
	e->d_size = d_size;
	e->exists = exists;
	rb_link_node(&e->rb, parent, p);
	rb_insert_color(&e->rb, &c->size_tree);
	return 0;
}