[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 16/76] block-backend: Expose bdrv_write_zeroes()
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 16/76] block-backend: Expose bdrv_write_zeroes() |
Date: |
Tue, 28 Apr 2015 16:59:58 +0200 |
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
---
block/block-backend.c | 11 +++++++++++
include/sysemu/block-backend.h | 2 ++
2 files changed, 13 insertions(+)
diff --git a/block/block-backend.c b/block/block-backend.c
index 48b6e4c..93e46f3 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -515,6 +515,17 @@ int blk_write(BlockBackend *blk, int64_t sector_num, const
uint8_t *buf,
return bdrv_write(blk->bs, sector_num, buf, nb_sectors);
}
+int blk_write_zeroes(BlockBackend *blk, int64_t sector_num,
+ int nb_sectors, BdrvRequestFlags flags)
+{
+ int ret = blk_check_request(blk, sector_num, nb_sectors);
+ if (ret < 0) {
+ return ret;
+ }
+
+ return bdrv_write_zeroes(blk->bs, sector_num, nb_sectors, flags);
+}
+
static void error_callback_bh(void *opaque)
{
struct BlockBackendAIOCB *acb = opaque;
diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h
index 77e9b9c..b4a4d5e 100644
--- a/include/sysemu/block-backend.h
+++ b/include/sysemu/block-backend.h
@@ -87,6 +87,8 @@ int blk_read_unthrottled(BlockBackend *blk, int64_t
sector_num, uint8_t *buf,
int nb_sectors);
int blk_write(BlockBackend *blk, int64_t sector_num, const uint8_t *buf,
int nb_sectors);
+int blk_write_zeroes(BlockBackend *blk, int64_t sector_num,
+ int nb_sectors, BdrvRequestFlags flags);
BlockAIOCB *blk_aio_write_zeroes(BlockBackend *blk, int64_t sector_num,
int nb_sectors, BdrvRequestFlags flags,
BlockCompletionFunc *cb, void *opaque);
--
1.8.3.1
- [Qemu-devel] [PULL 05/76] uninorth: convert ffs(3) to ctz32(), (continued)
- [Qemu-devel] [PULL 05/76] uninorth: convert ffs(3) to ctz32(), Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 08/76] sd: convert sd_normal_command() ffs(3) call to ctz32(), Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 06/76] Convert (ffs(val) - 1) to ctz32(val), Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 07/76] Convert ffs() != 0 callers to ctz32(), Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 09/76] omap_intc: convert ffs(3) to ctz32() in omap_inth_sir_update(), Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 11/76] checkpatch: complain about ffs(3) calls, Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 12/76] block: Switch to host monotonic clock for IO throttling, Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 10/76] os-win32: drop ffs(3) prototype, Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 13/76] aio-posix: move pollfds to thread-local storage, Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 14/76] AioContext: acquire/release AioContext during aio_poll, Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 16/76] block-backend: Expose bdrv_write_zeroes(),
Kevin Wolf <=
- [Qemu-devel] [PULL 15/76] iothread: release iothread around aio_poll, Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 18/76] qemu-iotests: Some qemu-img convert tests, Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 17/76] qemu-img convert: Rewrite copying logic, Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 19/76] blkdebug: Add bdrv_truncate(), Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 22/76] scripts: add 'qemu coroutine' command to qemu-gdb.py, Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 20/76] vhdx: Fix zero-fill iov length, Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 25/76] MAINTAINERS: Add Fam Zheng as Null block driver maintainer, Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 21/76] thread-pool: clean up thread_pool_completion_bh(), Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 23/76] block/null: Latency simulation by adding new option "latency-ns", Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 26/76] blockjob: Allow nested pause, Kevin Wolf, 2015/04/28