mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
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:
parent
b7d17f9fa4
commit
983a160050
6 changed files with 25 additions and 36 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue