summaryrefslogtreecommitdiff
path: root/block/vhdx.h
diff options
context:
space:
mode:
authorJeff Cody <jcody@redhat.com>2013-10-30 10:44:49 -0400
committerStefan Hajnoczi <stefanha@redhat.com>2013-11-07 13:58:59 +0100
commit0b7da092b40734538631c3ad461c1753a87535fc (patch)
treee8ca87c861263fb2f1748b7e8d24f282aec692b5 /block/vhdx.h
parentd92aa8833c051b53d3bf2614ff885df0037f10bb (diff)
downloadqemu-0b7da092b40734538631c3ad461c1753a87535fc.tar.gz
block: vhdx - remove BAT file offset bit shifting
Bit shifting can be fun, but in this case it was unnecessary. The upper 44 bits of the 64-bit BAT entry is specifies the File Offset, so we shifted the bits to get access to the value. However, per the spec the value is in MB. So we dutifully shifted back to the left by 20 bits, to convert to a true uint64_t file offset. This replaces those steps with just a bit mask, to get rid of the lower 20 bits instead. Signed-off-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block/vhdx.h')
-rw-r--r--block/vhdx.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/block/vhdx.h b/block/vhdx.h
index f3315480ea..d3598e0a27 100644
--- a/block/vhdx.h
+++ b/block/vhdx.h
@@ -229,7 +229,6 @@ typedef struct QEMU_PACKED VHDXLogDataSector {
/* upper 44 bits are the file offset in 1MB units lower 3 bits are the state
other bits are reserved */
#define VHDX_BAT_STATE_BIT_MASK 0x07
-#define VHDX_BAT_FILE_OFF_BITS (64 - 44)
#define VHDX_BAT_FILE_OFF_MASK 0xFFFFFFFFFFF00000 /* upper 44 bits */
typedef uint64_t VHDXBatEntry;