/* This is a helper function for 'check_leaf()' which searches inode @inum in the RB-tree of inodes and returns an inode information pointer or NULL if the inode was not found.  */
static struct fsck_inode* search_inode(struct fsck_data *fsckd, ino_t inum)
/* This is a helper function for 'check_leaf()' which searches inode @inum in the RB-tree of inodes and returns an inode information pointer or NULL if the inode was not found.  */
static struct fsck_inode* search_inode(struct fsck_data *fsckd, ino_t inum)
{
	struct rb_node *p;
	struct fsck_inode *fscki;
	p = fsckd->inodes.rb_node;
	while (p) {
		fscki = rb_entry(p, struct fsck_inode, rb);
		if (inum < fscki->inum)
			p = p->rb_left;
		else if (inum > fscki->inum)
			p = p->rb_right;
		else
			return fscki;
	}
	return NULL;
}