[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 18/31] block: Kill bdrv_co_write_zeroes()
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 18/31] block: Kill bdrv_co_write_zeroes() |
Date: |
Wed, 8 Jun 2016 11:16:44 +0200 |
From: Eric Blake <address@hidden>
Now that all drivers have been converted to a byte interface,
we no longer need a sector interface.
Signed-off-by: Eric Blake <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/io.c | 15 ++-------------
include/block/block_int.h | 2 --
2 files changed, 2 insertions(+), 15 deletions(-)
diff --git a/block/io.c b/block/io.c
index a426094..9dc265b 100644
--- a/block/io.c
+++ b/block/io.c
@@ -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) {
diff --git a/include/block/block_int.h b/include/block/block_int.h
index 1dfdf92..8a4963c 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -163,8 +163,6 @@ struct BlockDriver {
* function pointer may be NULL or return -ENOSUP and .bdrv_co_writev()
* will be called instead.
*/
- int coroutine_fn (*bdrv_co_write_zeroes)(BlockDriverState *bs,
- int64_t sector_num, int nb_sectors, BdrvRequestFlags flags);
int coroutine_fn (*bdrv_co_pwrite_zeroes)(BlockDriverState *bs,
int64_t offset, int count, BdrvRequestFlags flags);
int coroutine_fn (*bdrv_co_discard)(BlockDriverState *bs,
--
1.8.3.1
- [Qemu-block] [PULL 01/31] block: split write_zeroes always, (continued)
- [Qemu-block] [PULL 01/31] block: split write_zeroes always, Kevin Wolf, 2016/06/08
- [Qemu-block] [PULL 08/31] block: Add .bdrv_co_pwrite_zeroes(), Kevin Wolf, 2016/06/08
- [Qemu-block] [PULL 05/31] qcow2: Catch more unaligned write_zero into zero cluster, Kevin Wolf, 2016/06/08
- [Qemu-block] [PULL 03/31] qcow2: add tracepoints for qcow2_co_write_zeroes, Kevin Wolf, 2016/06/08
- [Qemu-block] [PULL 12/31] blkreplay: Convert to bdrv_co_pwrite_zeroes(), Kevin Wolf, 2016/06/08
- [Qemu-block] [PULL 11/31] qcow2: Convert to bdrv_co_pwrite_zeroes(), Kevin Wolf, 2016/06/08
- [Qemu-block] [PULL 13/31] gluster: Convert to bdrv_co_pwrite_zeroes(), Kevin Wolf, 2016/06/08
- [Qemu-block] [PULL 16/31] raw_bsd: Convert to bdrv_co_pwrite_zeroes(), Kevin Wolf, 2016/06/08
- [Qemu-block] [PULL 17/31] vmdk: Convert to bdrv_co_pwrite_zeroes(), Kevin Wolf, 2016/06/08
- [Qemu-block] [PULL 04/31] qemu-iotests: Test one more spot for optimizing write_zeroes, Kevin Wolf, 2016/06/08
- [Qemu-block] [PULL 18/31] block: Kill bdrv_co_write_zeroes(),
Kevin Wolf <=
- [Qemu-block] [PULL 22/31] raw-posix: Fetch max sectors for host block device, Kevin Wolf, 2016/06/08
- [Qemu-block] [PULL 19/31] migration/block: Convert load to BlockBackend, Kevin Wolf, 2016/06/08
- [Qemu-block] [PULL 14/31] qed: Convert to bdrv_co_pwrite_zeroes(), Kevin Wolf, 2016/06/08
- [Qemu-block] [PULL 20/31] migration/block: Convert saving to BlockBackend, Kevin Wolf, 2016/06/08
- [Qemu-block] [PULL 15/31] raw-posix: Convert to bdrv_co_pwrite_zeroes(), Kevin Wolf, 2016/06/08
- [Qemu-block] [PULL 23/31] qcow2: avoid extra flushes in qcow2, Kevin Wolf, 2016/06/08
- [Qemu-block] [PULL 27/31] qemu-img bench, Kevin Wolf, 2016/06/08
- [Qemu-block] [PULL 28/31] qemu-img bench: Sequential writes, Kevin Wolf, 2016/06/08
- [Qemu-block] [PULL 25/31] blockdev: clean up error handling in do_open_tray, Kevin Wolf, 2016/06/08
- [Qemu-block] [PULL 21/31] block: assert that bs->request_alignment is a power of 2, Kevin Wolf, 2016/06/08