qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 2/2] quorum: Implement bdrv_co_pwrite_zeroes()


From: Max Reitz
Subject: Re: [PATCH v3 2/2] quorum: Implement bdrv_co_pwrite_zeroes()
Date: Fri, 13 Nov 2020 17:11:20 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0

On 13.11.20 17:07, Alberto Garcia wrote:
On Fri 13 Nov 2020 12:49:04 PM CET, Max Reitz wrote:
On 11.11.20 17:53, Alberto Garcia wrote:
This simply calls bdrv_co_pwrite_zeroes() in all children

Signed-off-by: Alberto Garcia <berto@igalia.com>
---
   block/quorum.c             | 18 ++++++++++++++++--
   tests/qemu-iotests/312     |  7 +++++++
   tests/qemu-iotests/312.out |  4 ++++
   3 files changed, 27 insertions(+), 2 deletions(-)

Should we set supported_zero_flags to something?  I think we can at
least set BDRV_REQ_NO_FALLBACK.  We could also try BDRV_REQ_FUA.

We could set all supported_zero_flags as long as all children support
them, right?

Sure, I was just thinking that we could set these regardless of whether the children support them, because (on zero-writes) the block layer will figure out for us whether the child nodes support them. O:)

+    if (acb->flags & BDRV_REQ_ZERO_WRITE) {
+        sacb->ret = bdrv_co_pwrite_zeroes(s->children[i], acb->offset,
+                                          acb->bytes, acb->flags);
+    } else {
+        sacb->ret = bdrv_co_pwritev(s->children[i], acb->offset, acb->bytes,
+                                    acb->qiov, acb->flags);
+    }

Seems unnecessary (bdrv_co_pwritev() can handle BDRV_REQ_ZERO_WRITE),
but perhaps it’s good to be explicit.

pwrite_zeroes() does this additionaly:

     if (!(child->bs->open_flags & BDRV_O_UNMAP)) {
         flags &= ~BDRV_REQ_MAY_UNMAP;
     }

Interesting. Technically, Quorum doesn’t support that flag (in supported_zero_flags O:))), so it shouldn’t appear, but, er, well then.

Max




reply via email to

[Prev in Thread] Current Thread [Next in Thread]