[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 28/35] qcow2: Use BDRV_SECTOR_BITS instead of its lit
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 28/35] qcow2: Use BDRV_SECTOR_BITS instead of its literal value |
Date: |
Thu, 26 Oct 2017 15:17:34 +0200 |
From: Alberto Garcia <address@hidden>
BDRV_SECTOR_BITS is defined to be 9 in block.h (and BDRV_SECTOR_SIZE
is calculated from that), but there are still a couple of places where
we are using the literal value instead of the macro.
Signed-off-by: Alberto Garcia <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>
---
block/qcow2.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/block/qcow2.c b/block/qcow2.c
index fbf9464d3a..f77b490cc6 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -1139,7 +1139,7 @@ static int qcow2_do_open(BlockDriverState *bs, QDict
*options, int flags,
s->cluster_bits = header.cluster_bits;
s->cluster_size = 1 << s->cluster_bits;
- s->cluster_sectors = 1 << (s->cluster_bits - 9);
+ s->cluster_sectors = 1 << (s->cluster_bits - BDRV_SECTOR_BITS);
/* Initialise version 3 header fields */
if (header.version == 2) {
@@ -1636,7 +1636,7 @@ static int64_t coroutine_fn
qcow2_co_get_block_status(BlockDriverState *bs,
bytes = MIN(INT_MAX, nb_sectors * BDRV_SECTOR_SIZE);
qemu_co_mutex_lock(&s->lock);
- ret = qcow2_get_cluster_offset(bs, sector_num << 9, &bytes,
+ ret = qcow2_get_cluster_offset(bs, sector_num << BDRV_SECTOR_BITS, &bytes,
&cluster_offset);
qemu_co_mutex_unlock(&s->lock);
if (ret < 0) {
--
2.13.6
- [Qemu-block] [PULL 14/35] block: Convert bdrv_get_block_status_above() to bytes, (continued)
- [Qemu-block] [PULL 14/35] block: Convert bdrv_get_block_status_above() to bytes, Kevin Wolf, 2017/10/26
- [Qemu-block] [PULL 18/35] qemu-img: Drop redundant error message in compare, Kevin Wolf, 2017/10/26
- [Qemu-block] [PULL 19/35] qemu-img: Change check_empty_sectors() to byte-based, Kevin Wolf, 2017/10/26
- [Qemu-block] [PULL 23/35] block: Align block status requests, Kevin Wolf, 2017/10/26
- [Qemu-block] [PULL 24/35] block: Reduce bdrv_aligned_preadv() rounding, Kevin Wolf, 2017/10/26
- [Qemu-block] [PULL 20/35] qemu-img: Change compare_sectors() to be byte-based, Kevin Wolf, 2017/10/26
- [Qemu-block] [PULL 22/35] qemu-img: Change img_compare() to be byte-based, Kevin Wolf, 2017/10/26
- [Qemu-block] [PULL 21/35] qemu-img: Change img_rebase() to be byte-based, Kevin Wolf, 2017/10/26
- [Qemu-block] [PULL 25/35] qcow2: Reduce is_zero() rounding, Kevin Wolf, 2017/10/26
- [Qemu-block] [PULL 27/35] qemu-img.1: Image invalidation on qemu-img commit, Kevin Wolf, 2017/10/26
- [Qemu-block] [PULL 28/35] qcow2: Use BDRV_SECTOR_BITS instead of its literal value,
Kevin Wolf <=
- [Qemu-block] [PULL 26/35] qemu-io: Relax 'alloc' now that block-status doesn't assert, Kevin Wolf, 2017/10/26
- [Qemu-block] [PULL 30/35] iotests: Pull _filter_actual_image_size from 67/87, Kevin Wolf, 2017/10/26
- [Qemu-block] [PULL 31/35] iotests: Filter actual image size in 184 and 191, Kevin Wolf, 2017/10/26
- [Qemu-block] [PULL 29/35] iotests: Add test for dataplane mirroring, Kevin Wolf, 2017/10/26
- [Qemu-block] [PULL 32/35] qcow2: Emit errp when truncating the image tail, Kevin Wolf, 2017/10/26
- [Qemu-block] [PULL 33/35] qcow2: Fix unaligned preallocated truncation, Kevin Wolf, 2017/10/26
- [Qemu-block] [PULL 34/35] qcow2: Always execute preallocate() in a coroutine, Kevin Wolf, 2017/10/26
- [Qemu-block] [PULL 35/35] iotests: Add cluster_size=64k to 125, Kevin Wolf, 2017/10/26
- Re: [Qemu-block] [Qemu-devel] [PULL 00/35] Block layer patches, Peter Maydell, 2017/10/27