/* This function walks all UBI devices and volumes and sends the UBI_VOLUME_ADDED notification for each volume. If @nb is NULL, then all registered notifiers are called, otherwise only the @nb notifier is called. Returns the number of sent notifications.  */
int ubi_enumerate_volumes(struct notifier_block *nb)
/* This function walks all UBI devices and volumes and sends the UBI_VOLUME_ADDED notification for each volume. If @nb is NULL, then all registered notifiers are called, otherwise only the @nb notifier is called. Returns the number of sent notifications.  */
int ubi_enumerate_volumes(struct notifier_block *nb)
{
	int i, count = 0;
	for (i = 0; i < UBI_MAX_DEVICES; i++) {
		struct ubi_device *ubi = ubi_devices[i];
		if (!ubi)
			continue;
		count += ubi_notify_all(ubi, UBI_VOLUME_ADDED, nb);
	}
	return count;
}