/* This function is called every time an UBI volume is re-size. It changes the corresponding fake MTD device size. This function returns zero in case of success and a negative error code in case of error.  */
static int gluebi_resized(struct ubi_volume_info *vi)
/* This function is called every time an UBI volume is re-size. It changes the corresponding fake MTD device size. This function returns zero in case of success and a negative error code in case of error.  */
static int gluebi_resized(struct ubi_volume_info *vi)
{
	struct gluebi_device *gluebi;
	mutex_lock(&devices_mutex);
	gluebi = find_gluebi_nolock(vi->ubi_num, vi->vol_id);
	if (!gluebi) {
		mutex_unlock(&devices_mutex);
		err_msg("got update notification for unknown UBI device %d "
			"volume %d", vi->ubi_num, vi->vol_id);
		return -ENOENT;
	}
	gluebi->mtd.size = vi->used_bytes;
	mutex_unlock(&devices_mutex);
	return 0;
}