diff options
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/virtio_blk.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 655e570b9b31..5ea2f0bbbc7c 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c | |||
@@ -342,7 +342,7 @@ static void virtblk_config_changed_work(struct work_struct *work) | |||
342 | struct request_queue *q = vblk->disk->queue; | 342 | struct request_queue *q = vblk->disk->queue; |
343 | char cap_str_2[10], cap_str_10[10]; | 343 | char cap_str_2[10], cap_str_10[10]; |
344 | char *envp[] = { "RESIZE=1", NULL }; | 344 | char *envp[] = { "RESIZE=1", NULL }; |
345 | u64 capacity, size; | 345 | u64 capacity; |
346 | 346 | ||
347 | /* Host must always specify the capacity. */ | 347 | /* Host must always specify the capacity. */ |
348 | virtio_cread(vdev, struct virtio_blk_config, capacity, &capacity); | 348 | virtio_cread(vdev, struct virtio_blk_config, capacity, &capacity); |
@@ -354,9 +354,10 @@ static void virtblk_config_changed_work(struct work_struct *work) | |||
354 | capacity = (sector_t)-1; | 354 | capacity = (sector_t)-1; |
355 | } | 355 | } |
356 | 356 | ||
357 | size = capacity * queue_logical_block_size(q); | 357 | string_get_size(capacity, queue_logical_block_size(q), |
358 | string_get_size(size, STRING_UNITS_2, cap_str_2, sizeof(cap_str_2)); | 358 | STRING_UNITS_2, cap_str_2, sizeof(cap_str_2)); |
359 | string_get_size(size, STRING_UNITS_10, cap_str_10, sizeof(cap_str_10)); | 359 | string_get_size(capacity, queue_logical_block_size(q), |
360 | STRING_UNITS_10, cap_str_10, sizeof(cap_str_10)); | ||
360 | 361 | ||
361 | dev_notice(&vdev->dev, | 362 | dev_notice(&vdev->dev, |
362 | "new size: %llu %d-byte logical blocks (%s/%s)\n", | 363 | "new size: %llu %d-byte logical blocks (%s/%s)\n", |