[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 13/20] iscsi: Support BDRV_REQ_FUA
From: |
Max Reitz |
Subject: |
Re: [Qemu-devel] [PATCH 13/20] iscsi: Support BDRV_REQ_FUA |
Date: |
Sat, 26 Mar 2016 21:44:39 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 |
On 18.03.2016 19:21, Kevin Wolf wrote:
> This replaces the existing hack in the iscsi driver that sent the FUA
> bit in writethrough mode and ignored the following flush in order to
> optimise the number of roundtrips (see commit 73b5394e).
>
> Signed-off-by: Kevin Wolf <address@hidden>
> ---
> block/iscsi.c | 24 +++++++-----------------
> 1 file changed, 7 insertions(+), 17 deletions(-)
>
> diff --git a/block/iscsi.c b/block/iscsi.c
> index 3b54536..4f75204 100644
> --- a/block/iscsi.c
> +++ b/block/iscsi.c
[...]
> @@ -1851,7 +1840,8 @@ static BlockDriver bdrv_iscsi = {
> .bdrv_co_discard = iscsi_co_discard,
> .bdrv_co_write_zeroes = iscsi_co_write_zeroes,
> .bdrv_co_readv = iscsi_co_readv,
> - .bdrv_co_writev = iscsi_co_writev,
> + .bdrv_co_writev_flags = iscsi_co_writev_flags,
> + .supported_write_flags = BDRV_REQ_FUA,
> .bdrv_co_flush_to_disk = iscsi_co_flush,
>
> #ifdef __linux__
>
Hm, wait, maybe not R-b. I can see three places in block/io.c which call
bdrv_co_writev(), and only one of them diverts to bdrv_co_writev_flags()
if that is available. Maybe we don't need to care about the
bounce-buffer case for write_zeroes, but I do think we need to care
about the COR case.
Of course bdrv_co_writev() can trivially be forwarded to
bdrv_co_writev_flags(), but I'm not sure who is supposed to do this
forwarding. I can imagine three ways:
(1) Keep a wrapper per block driver. Simple, but not so elegant.
(2) Make all bdrv_co_writev() callers call bdrv_co_writev_flags() if
the former is not available but the latter is.
(3) Introduce a generic function replacing every drv->bdrv_co_writev()
call which then decides which driver function to invoke.
Max
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH 10/20] block: Move enable_write_cache to BB level, (continued)
- [Qemu-devel] [PATCH 10/20] block: Move enable_write_cache to BB level, Kevin Wolf, 2016/03/18
- [Qemu-devel] [PATCH 16/20] block: Use bdrv_parse_cache_mode() in drive_init(), Kevin Wolf, 2016/03/18
- [Qemu-devel] [PATCH 15/20] raw: Support BDRV_REQ_FUA, Kevin Wolf, 2016/03/18
- [Qemu-devel] [PATCH 12/20] block: Introduce bdrv_co_writev_flags(), Kevin Wolf, 2016/03/18
- [Qemu-devel] [PATCH 13/20] iscsi: Support BDRV_REQ_FUA, Kevin Wolf, 2016/03/18
- [Qemu-devel] [PATCH 11/20] block/qapi: Use blk_enable_write_cache(), Kevin Wolf, 2016/03/18
- [Qemu-devel] [PATCH 14/20] nbd: Support BDRV_REQ_FUA, Kevin Wolf, 2016/03/18
- [Qemu-devel] [PATCH 18/20] block: Remove bdrv_parse_cache_flags(), Kevin Wolf, 2016/03/18
- [Qemu-devel] [PATCH 17/20] qemu-io: Use bdrv_parse_cache_mode() in reopen_f(), Kevin Wolf, 2016/03/18