]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commit
block: vhdx - remove BAT file offset bit shifting
authorJeff Cody <jcody@redhat.com>
Wed, 30 Oct 2013 14:44:49 +0000 (10:44 -0400)
committerStefan Hajnoczi <stefanha@redhat.com>
Thu, 7 Nov 2013 12:58:59 +0000 (13:58 +0100)
commit0b7da092b40734538631c3ad461c1753a87535fc
treee8ca87c861263fb2f1748b7e8d24f282aec692b5
parentd92aa8833c051b53d3bf2614ff885df0037f10bb
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>
block/vhdx.c
block/vhdx.h