[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 39/48] raw: Support BDRV_REQ_FUA
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 39/48] raw: Support BDRV_REQ_FUA |
Date: |
Tue, 29 Mar 2016 17:08:39 +0200 |
Pass through the FUA flag to the lower layer so that the separate flush
can be saved in practically relevant cases where a (raw) format driver
sits on top of the protocol driver.
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
---
block/raw_bsd.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/block/raw_bsd.c b/block/raw_bsd.c
index ea16a23..8747bca 100644
--- a/block/raw_bsd.c
+++ b/block/raw_bsd.c
@@ -56,8 +56,9 @@ static int coroutine_fn raw_co_readv(BlockDriverState *bs,
int64_t sector_num,
return bdrv_co_readv(bs->file->bs, sector_num, nb_sectors, qiov);
}
-static int coroutine_fn raw_co_writev(BlockDriverState *bs, int64_t sector_num,
- int nb_sectors, QEMUIOVector *qiov)
+static int coroutine_fn
+raw_co_writev_flags(BlockDriverState *bs, int64_t sector_num, int nb_sectors,
+ QEMUIOVector *qiov, int flags)
{
void *buf = NULL;
BlockDriver *drv;
@@ -103,7 +104,8 @@ static int coroutine_fn raw_co_writev(BlockDriverState *bs,
int64_t sector_num,
}
BLKDBG_EVENT(bs->file, BLKDBG_WRITE_AIO);
- ret = bdrv_co_writev(bs->file->bs, sector_num, nb_sectors, qiov);
+ ret = bdrv_co_do_pwritev(bs->file->bs, sector_num * BDRV_SECTOR_SIZE,
+ nb_sectors * BDRV_SECTOR_SIZE, qiov, flags);
fail:
if (qiov == &local_qiov) {
@@ -113,6 +115,13 @@ fail:
return ret;
}
+static int coroutine_fn
+raw_co_writev(BlockDriverState *bs, int64_t sector_num, int nb_sectors,
+ QEMUIOVector *qiov)
+{
+ return raw_co_writev_flags(bs, sector_num, nb_sectors, qiov, 0);
+}
+
static int64_t coroutine_fn raw_co_get_block_status(BlockDriverState *bs,
int64_t sector_num,
int nb_sectors, int *pnum,
@@ -247,6 +256,8 @@ BlockDriver bdrv_raw = {
.bdrv_create = &raw_create,
.bdrv_co_readv = &raw_co_readv,
.bdrv_co_writev = &raw_co_writev,
+ .bdrv_co_writev_flags = &raw_co_writev_flags,
+ .supported_write_flags = BDRV_REQ_FUA,
.bdrv_co_write_zeroes = &raw_co_write_zeroes,
.bdrv_co_discard = &raw_co_discard,
.bdrv_co_get_block_status = &raw_co_get_block_status,
--
1.8.3.1
- [Qemu-devel] [PULL 28/48] qemu-img: Expand all BDRV_O_FLAGS uses, (continued)
- [Qemu-devel] [PULL 28/48] qemu-img: Expand all BDRV_O_FLAGS uses, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 29/48] qemu-img: Call blk_set_enable_write_cache() explicitly, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 27/48] qemu-io: Call blk_set_enable_write_cache() explicitly, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 24/48] replay: introduce block devices record/replay, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 30/48] xen_disk: Call blk_set_enable_write_cache() explicitly, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 33/48] block: Handle flush error in bdrv_pwrite_sync(), Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 31/48] block: blockdev_init(): Call blk_set_enable_write_cache() explicitly, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 34/48] block: Move enable_write_cache to BB level, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 37/48] iscsi: Support BDRV_REQ_FUA, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 32/48] block: Always set writeback mode in blk_new_open(), Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 39/48] raw: Support BDRV_REQ_FUA,
Kevin Wolf <=
- [Qemu-devel] [PULL 36/48] block: Introduce bdrv_co_writev_flags(), Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 35/48] block/qapi: Use blk_enable_write_cache(), Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 38/48] nbd: Support BDRV_REQ_FUA, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 41/48] qemu-io: Use bdrv_parse_cache_mode() in reopen_f(), Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 44/48] block: Remove bdrv_(set_)enable_write_cache(), Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 40/48] block: Use bdrv_parse_cache_mode() in drive_init(), Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 20/48] block: an interoperability test for luks vs dm-crypt/cryptsetup, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 42/48] block: Remove bdrv_parse_cache_flags(), Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 46/48] block/null-{co, aio}: Allow reading zeroes, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 43/48] block: Remove BDRV_O_CACHE_WB, Kevin Wolf, 2016/03/29