|
@@ -188,8 +188,9 @@ static int ubiblock_read_to_buf(struct ubiblock *dev, char *buffer,
|
|
|
|
|
|
ret = ubi_read(dev->desc, leb, buffer, offset, len);
|
|
ret = ubi_read(dev->desc, leb, buffer, offset, len);
|
|
if (ret) {
|
|
if (ret) {
|
|
- ubi_err("%s ubi_read error %d",
|
|
|
|
- dev->gd->disk_name, ret);
|
|
|
|
|
|
+ ubi_err("%s: error %d while reading from LEB %d (offset %d, "
|
|
|
|
+ "length %d)", dev->gd->disk_name, ret, leb, offset,
|
|
|
|
+ len);
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
return 0;
|
|
return 0;
|
|
@@ -378,7 +379,7 @@ int ubiblock_create(struct ubi_volume_info *vi)
|
|
{
|
|
{
|
|
struct ubiblock *dev;
|
|
struct ubiblock *dev;
|
|
struct gendisk *gd;
|
|
struct gendisk *gd;
|
|
- u64 disk_capacity = ((u64)vi->size * vi->usable_leb_size) >> 9;
|
|
|
|
|
|
+ u64 disk_capacity = vi->used_bytes >> 9;
|
|
int ret;
|
|
int ret;
|
|
|
|
|
|
if ((sector_t)disk_capacity != disk_capacity)
|
|
if ((sector_t)disk_capacity != disk_capacity)
|
|
@@ -502,7 +503,7 @@ int ubiblock_remove(struct ubi_volume_info *vi)
|
|
static int ubiblock_resize(struct ubi_volume_info *vi)
|
|
static int ubiblock_resize(struct ubi_volume_info *vi)
|
|
{
|
|
{
|
|
struct ubiblock *dev;
|
|
struct ubiblock *dev;
|
|
- u64 disk_capacity = ((u64)vi->size * vi->usable_leb_size) >> 9;
|
|
|
|
|
|
+ u64 disk_capacity = vi->used_bytes >> 9;
|
|
|
|
|
|
/*
|
|
/*
|
|
* Need to lock the device list until we stop using the device,
|
|
* Need to lock the device list until we stop using the device,
|
|
@@ -524,7 +525,7 @@ static int ubiblock_resize(struct ubi_volume_info *vi)
|
|
|
|
|
|
mutex_lock(&dev->dev_mutex);
|
|
mutex_lock(&dev->dev_mutex);
|
|
set_capacity(dev->gd, disk_capacity);
|
|
set_capacity(dev->gd, disk_capacity);
|
|
- ubi_msg("%s resized to %d LEBs", dev->gd->disk_name, vi->size);
|
|
|
|
|
|
+ ubi_msg("%s resized to %lld bytes", dev->gd->disk_name, vi->used_bytes);
|
|
mutex_unlock(&dev->dev_mutex);
|
|
mutex_unlock(&dev->dev_mutex);
|
|
mutex_unlock(&devices_mutex);
|
|
mutex_unlock(&devices_mutex);
|
|
return 0;
|
|
return 0;
|