diff options
author | Eric Blake <eblake@redhat.com> | 2016-06-01 15:10:13 -0600 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2016-06-08 10:21:08 +0200 |
commit | c1499a5e73ae81b597869263ed8ac87bdaafeff7 (patch) | |
tree | 7da43bbf382847893523d95eb6b1b74bdc952406 /block | |
parent | a620f2ae1566a72aac289d40d72decbf95fc6de8 (diff) | |
download | qemu-c1499a5e73ae81b597869263ed8ac87bdaafeff7.zip qemu-c1499a5e73ae81b597869263ed8ac87bdaafeff7.tar.gz qemu-c1499a5e73ae81b597869263ed8ac87bdaafeff7.tar.bz2 |
block: Kill bdrv_co_write_zeroes()
Now that all drivers have been converted to a byte interface,
we no longer need a sector interface.
Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/io.c | 15 |
1 files changed, 2 insertions, 13 deletions
@@ -901,7 +901,7 @@ static int coroutine_fn bdrv_co_do_copy_on_readv(BlockDriverState *bs, goto err; } - if ((drv->bdrv_co_write_zeroes || drv->bdrv_co_pwrite_zeroes) && + if (drv->bdrv_co_pwrite_zeroes && buffer_is_zero(bounce_buffer, iov.iov_len)) { ret = bdrv_co_do_pwrite_zeroes(bs, cluster_sector_num * BDRV_SECTOR_SIZE, @@ -1170,16 +1170,6 @@ static int coroutine_fn bdrv_co_do_pwrite_zeroes(BlockDriverState *bs, !(bs->supported_zero_flags & BDRV_REQ_FUA)) { need_flush = true; } - } else if (drv->bdrv_co_write_zeroes) { - assert(offset % BDRV_SECTOR_SIZE == 0); - assert(count % BDRV_SECTOR_SIZE == 0); - ret = drv->bdrv_co_write_zeroes(bs, offset >> BDRV_SECTOR_BITS, - num >> BDRV_SECTOR_BITS, - flags & bs->supported_zero_flags); - if (ret != -ENOTSUP && (flags & BDRV_REQ_FUA) && - !(bs->supported_zero_flags & BDRV_REQ_FUA)) { - need_flush = true; - } } else { assert(!bs->supported_zero_flags); } @@ -1259,8 +1249,7 @@ static int coroutine_fn bdrv_aligned_pwritev(BlockDriverState *bs, ret = notifier_with_return_list_notify(&bs->before_write_notifiers, req); if (!ret && bs->detect_zeroes != BLOCKDEV_DETECT_ZEROES_OPTIONS_OFF && - !(flags & BDRV_REQ_ZERO_WRITE) && - (drv->bdrv_co_pwrite_zeroes || drv->bdrv_co_write_zeroes) && + !(flags & BDRV_REQ_ZERO_WRITE) && drv->bdrv_co_pwrite_zeroes && qemu_iovec_is_zero(qiov)) { flags |= BDRV_REQ_ZERO_WRITE; if (bs->detect_zeroes == BLOCKDEV_DETECT_ZEROES_OPTIONS_UNMAP) { |