block: Switch blk_*write_zeroes() to byte interface

Sector-based blk_write() should die; convert the one-off
variant blk_write_zeroes() to use an offset/count interface
instead.  Likewise for blk_co_write_zeroes() and
blk_aio_write_zeroes().

Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Eric Blake 2016-05-06 10:26:29 -06:00 committed by Kevin Wolf
parent b7d17f9fa4
commit 983a160050
6 changed files with 25 additions and 36 deletions

View file

@ -494,8 +494,7 @@ static void coroutine_fn co_write_zeroes_entry(void *opaque)
{
CoWriteZeroes *data = opaque;
data->ret = blk_co_write_zeroes(data->blk, data->offset / BDRV_SECTOR_SIZE,
data->count / BDRV_SECTOR_SIZE, 0);
data->ret = blk_co_write_zeroes(data->blk, data->offset, data->count, 0);
data->done = true;
if (data->ret < 0) {
*data->total = data->ret;
@ -1704,8 +1703,7 @@ static int aio_write_f(BlockBackend *blk, int argc, char **argv)
}
ctx->qiov.size = count;
blk_aio_write_zeroes(blk, ctx->offset >> 9, count >> 9, 0,
aio_write_done, ctx);
blk_aio_write_zeroes(blk, ctx->offset, count, 0, aio_write_done, ctx);
} else {
nr_iov = argc - optind;
ctx->buf = create_iovec(blk, &ctx->qiov, &argv[optind], nr_iov,