aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2016-06-08 17:17:16 +0100
committerPeter Maydell <peter.maydell@linaro.org>2016-06-08 17:17:16 +0100
commit6f50f25c825fbd0edd2dc43b9a63edfecfd4a3e9 (patch)
tree80fee285db6153395963b01591d27d5053c1ec4c /include
parentd36ebffe945d744a1605b30a8fd208b5325c1505 (diff)
parent55d539c8f75abab70301a43d8c94b976f6ddc358 (diff)
Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
Block layer patches # gpg: Signature made Wed 08 Jun 2016 09:31:38 BST # gpg: using RSA key 0x7F09B272C88F2FD6 # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" * remotes/kevin/tags/for-upstream: (31 commits) qemu-img bench: Add --flush-interval qemu-img bench: Implement -S (step size) qemu-img bench: Make start offset configurable qemu-img bench: Sequential writes qemu-img bench block: Don't emulate natively supported pwritev flags blockdev: clean up error handling in do_open_tray block: Fix bdrv_all_delete_snapshot() error handling qcow2: avoid extra flushes in qcow2 raw-posix: Fetch max sectors for host block device block: assert that bs->request_alignment is a power of 2 migration/block: Convert saving to BlockBackend migration/block: Convert load to BlockBackend block: Kill bdrv_co_write_zeroes() vmdk: Convert to bdrv_co_pwrite_zeroes() raw_bsd: Convert to bdrv_co_pwrite_zeroes() raw-posix: Convert to bdrv_co_pwrite_zeroes() qed: Convert to bdrv_co_pwrite_zeroes() gluster: Convert to bdrv_co_pwrite_zeroes() blkreplay: Convert to bdrv_co_pwrite_zeroes() ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include')
-rw-r--r--include/block/block.h10
-rw-r--r--include/block/block_int.h16
2 files changed, 14 insertions, 12 deletions
diff --git a/include/block/block.h b/include/block/block.h
index 3fd5043d01..54cca28bac 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -33,7 +33,7 @@ typedef struct BlockDriverInfo {
* True if the driver can optimize writing zeroes by unmapping
* sectors. This is equivalent to the BLKDISCARDZEROES ioctl in Linux
* with the difference that in qemu a discard is allowed to silently
- * fail. Therefore we have to use bdrv_write_zeroes with the
+ * fail. Therefore we have to use bdrv_pwrite_zeroes with the
* BDRV_REQ_MAY_UNMAP flag for an optimized zero write with unmapping.
* After this call the driver has to guarantee that the contents read
* back as zero. It is additionally required that the block device is
@@ -227,8 +227,8 @@ int bdrv_read(BlockDriverState *bs, int64_t sector_num,
uint8_t *buf, int nb_sectors);
int bdrv_write(BlockDriverState *bs, int64_t sector_num,
const uint8_t *buf, int nb_sectors);
-int bdrv_write_zeroes(BlockDriverState *bs, int64_t sector_num,
- int nb_sectors, BdrvRequestFlags flags);
+int bdrv_pwrite_zeroes(BlockDriverState *bs, int64_t offset,
+ int count, BdrvRequestFlags flags);
int bdrv_make_zero(BlockDriverState *bs, BdrvRequestFlags flags);
int bdrv_pread(BlockDriverState *bs, int64_t offset,
void *buf, int count);
@@ -247,8 +247,8 @@ int coroutine_fn bdrv_co_writev(BlockDriverState *bs, int64_t sector_num,
* function is not suitable for zeroing the entire image in a single request
* because it may allocate memory for the entire region.
*/
-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);
BlockDriverState *bdrv_find_backing_image(BlockDriverState *bs,
const char *backing_file);
int bdrv_get_backing_file_depth(BlockDriverState *bs);
diff --git a/include/block/block_int.h b/include/block/block_int.h
index 30a97178c8..8a4963c4fe 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -163,8 +163,8 @@ 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,
int64_t sector_num, int nb_sectors);
int64_t coroutine_fn (*bdrv_co_get_block_status)(BlockDriverState *bs,
@@ -328,11 +328,13 @@ typedef struct BlockLimits {
/* optimal alignment for discard requests in sectors */
int64_t discard_alignment;
- /* maximum number of sectors that can zeroized at once */
- int max_write_zeroes;
+ /* maximum number of bytes that can zeroized at once (since it is
+ * signed, it must be < 2G, if set) */
+ int32_t max_pwrite_zeroes;
- /* optimal alignment for write zeroes requests in sectors */
- int64_t write_zeroes_alignment;
+ /* optimal alignment for write zeroes requests in bytes, must be
+ * power of 2, and less than max_pwrite_zeroes if that is set */
+ uint32_t pwrite_zeroes_alignment;
/* optimal transfer length in sectors */
int opt_transfer_length;
@@ -454,7 +456,7 @@ struct BlockDriverState {
unsigned int request_alignment;
/* Flags honored during pwrite (so far: BDRV_REQ_FUA) */
unsigned int supported_write_flags;
- /* Flags honored during write_zeroes (so far: BDRV_REQ_FUA,
+ /* Flags honored during pwrite_zeroes (so far: BDRV_REQ_FUA,
* BDRV_REQ_MAY_UNMAP) */
unsigned int supported_zero_flags;