OSDN Git Service

vhdx: Rework truncation logic
authorEric Blake <eblake@redhat.com>
Tue, 28 Apr 2020 20:29:04 +0000 (15:29 -0500)
committerKevin Wolf <kwolf@redhat.com>
Fri, 8 May 2020 11:26:35 +0000 (13:26 +0200)
commitdbc636e791ad04b6bcdec982d2b9c45d7182e037
tree0db058489ccead7a9f1c8b574157a4cc2c4728da
parentbda4cdcbb997d34762e2af27e1f475357a9b4453
vhdx: Rework truncation logic

The vhdx driver uses truncation for image growth, with a special case
for blocks that already read as zero but which are only being
partially written.  But with a bit of rearranging, it's just as easy
to defer the decision on whether truncation resulted in zeroes to the
actual allocation attempt, reducing the number of places that still
use bdrv_has_zero_init_truncate.

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20200428202905.770727-9-eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/vhdx.c