[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v11 9/9] qcow2: Explicit number replaced by a consta
From: |
Leonid Bloch |
Subject: |
[Qemu-devel] [PATCH v11 9/9] qcow2: Explicit number replaced by a constant |
Date: |
Tue, 25 Sep 2018 01:53:57 +0300 |
Signed-off-by: Leonid Bloch <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
---
block/qcow2.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/block/qcow2.c b/block/qcow2.c
index 3c1859f9cc..983d4361d7 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -1324,7 +1324,7 @@ static int coroutine_fn qcow2_do_open(BlockDriverState
*bs, QDict *options,
/* 2^(s->refcount_order - 3) is the refcount width in bytes */
s->refcount_block_bits = s->cluster_bits - (s->refcount_order - 3);
s->refcount_block_size = 1 << s->refcount_block_bits;
- bs->total_sectors = header.size / 512;
+ bs->total_sectors = header.size / BDRV_SECTOR_SIZE;
s->csize_shift = (62 - (s->cluster_bits - 8));
s->csize_mask = (1 << (s->cluster_bits - 8)) - 1;
s->cluster_offset_mask = (1LL << s->csize_shift) - 1;
@@ -3450,7 +3450,7 @@ static int coroutine_fn
qcow2_co_truncate(BlockDriverState *bs, int64_t offset,
goto fail;
}
- old_length = bs->total_sectors * 512;
+ old_length = bs->total_sectors * BDRV_SECTOR_SIZE;
new_l1_size = size_to_l1(s, offset);
if (offset < old_length) {
--
2.17.1
- [Qemu-devel] [PATCH v11 0/9] Take the image size into account when allocating the L2 cache, Leonid Bloch, 2018/09/24
- [Qemu-devel] [PATCH v11 7/9] qcow2: Resize the cache upon image resizing, Leonid Bloch, 2018/09/24
- [Qemu-devel] [PATCH v11 8/9] qcow2: Set the default cache-clean-interval to 10 minutes, Leonid Bloch, 2018/09/24
- [Qemu-devel] [PATCH v11 9/9] qcow2: Explicit number replaced by a constant,
Leonid Bloch <=
- [Qemu-devel] [PATCH v11 6/9] qcow2: Increase the default upper limit on the L2 cache size, Leonid Bloch, 2018/09/24
- [Qemu-devel] [PATCH v11 4/9] qcow2: Avoid duplication in setting the refcount cache size, Leonid Bloch, 2018/09/24
- [Qemu-devel] [PATCH v11 5/9] qcow2: Assign the L2 cache relatively to the image size, Leonid Bloch, 2018/09/24
- [Qemu-devel] [PATCH v11 3/9] qcow2: Make sizes more humanly readable, Leonid Bloch, 2018/09/24
- [Qemu-devel] [PATCH v11 2/9] include: Add a lookup table of sizes, Leonid Bloch, 2018/09/24
- [Qemu-devel] [PATCH v11 1/9] qcow2: Options' documentation fixes, Leonid Bloch, 2018/09/24
- Re: [Qemu-devel] [PATCH v11 0/9] Take the image size into account when allocating the L2 cache, Kevin Wolf, 2018/09/26