/* This function returns a pointer to the volume description or NULL if there are no data about this volume in the scanning information.  */
struct ubi_scan_volume* ubi_scan_find_sv(const struct ubi_scan_info *si, int vol_id)
/* This function returns a pointer to the volume description or NULL if there are no data about this volume in the scanning information.  */
struct ubi_scan_volume* ubi_scan_find_sv(const struct ubi_scan_info *si, int vol_id)
{
	struct ubi_scan_volume *sv;
	struct rb_node *p = si->volumes.rb_node;
	while (p) {
		sv = rb_entry(p, struct ubi_scan_volume, rb);
		if (vol_id == sv->vol_id)
			return sv;
		if (vol_id > sv->vol_id)
			p = p->rb_left;
		else
			p = p->rb_right;
	}
	return NULL;
}