/* This function returns a pointer to the scanning logical eraseblock or NULL if there are no data about it in the scanning volume information.  */
struct ubi_scan_leb* ubi_scan_find_seb(const struct ubi_scan_volume *sv, int lnum)
/* This function returns a pointer to the scanning logical eraseblock or NULL if there are no data about it in the scanning volume information.  */
struct ubi_scan_leb* ubi_scan_find_seb(const struct ubi_scan_volume *sv, int lnum)
{
	struct ubi_scan_leb *seb;
	struct rb_node *p = sv->root.rb_node;
	while (p) {
		seb = rb_entry(p, struct ubi_scan_leb, u.rb);
		if (lnum == seb->lnum)
			return seb;
		if (lnum > seb->lnum)
			p = p->rb_left;
		else
			p = p->rb_right;
	}
	return NULL;
}