]> git.proxmox.com Git - mirror_qemu.git/commit
file-posix: Switch to .bdrv_co_block_status()
authorEric Blake <eblake@redhat.com>
Tue, 13 Feb 2018 20:26:44 +0000 (14:26 -0600)
committerKevin Wolf <kwolf@redhat.com>
Fri, 2 Mar 2018 17:39:07 +0000 (18:39 +0100)
commita290f085901b528265787cd27ebda19c970be4ee
tree8073eaa878ed15b0acb212923dfb610c09325e88
parent3e4d0e72b77b70578d5530af588d6f0484e18325
file-posix: Switch to .bdrv_co_block_status()

We are gradually moving away from sector-based interfaces, towards
byte-based.  Update the file protocol driver accordingly.

In want_zero mode, we continue to report fine-grained hole
information (the caller wants as much mapping detail as possible);
but when not in that mode, the caller prefers larger *pnum and
merely cares about what offsets are allocated at this layer, rather
than where the holes live.  Since holes still read as zeroes at
this layer (rather than deferring to a backing layer), we can take
the shortcut of skipping lseek(), and merely state that all bytes
are allocated.

We can also drop redundant bounds checks that are already
guaranteed by the block layer.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/file-posix.c