[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v7 4/9] block: treat BDRV_REQ_ALLOCATE as serial
From: |
Alberto Garcia |
Subject: |
Re: [Qemu-devel] [PATCH v7 4/9] block: treat BDRV_REQ_ALLOCATE as serialising |
Date: |
Wed, 31 Jan 2018 16:11:06 +0100 |
User-agent: |
Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu) |
On Thu 18 Jan 2018 06:49:02 PM CET, Anton Nefedov wrote:
> -static bool coroutine_fn wait_serialising_requests(BdrvTrackedRequest *self)
> +static bool coroutine_fn wait_serialising_requests(BdrvTrackedRequest *self,
> + bool nowait)
It's a bit confusing to have a function called wait_foo() with a
parameter that says "don't wait"...
How about
check_serialising_requests(BdrvTrackedRequest *self, bool wait)
> - waited = wait_serialising_requests(req);
> + waited = wait_serialising_requests(req, flags & BDRV_REQ_ALLOCATE);
> + if (waited && flags & BDRV_REQ_ALLOCATE) {
> + return -EAGAIN;
> + }
I find this more readable (even if not strictly necessary):
if (waited && (flags & BDRV_REQ_ALLOCATE)) {
None of my two comments are blockers, though, so
Reviewed-by: Alberto Garcia <address@hidden>
Berto
- [Qemu-devel] [PATCH v7 0/9] qcow2: cluster space preallocation, Anton Nefedov, 2018/01/18
- [Qemu-devel] [PATCH v7 6/9] block: support BDRV_REQ_ALLOCATE in passthrough drivers, Anton Nefedov, 2018/01/18
- [Qemu-devel] [PATCH v7 5/9] file-posix: support BDRV_REQ_ALLOCATE, Anton Nefedov, 2018/01/18
- [Qemu-devel] [PATCH v7 2/9] blkverify: set supported write/zero flags, Anton Nefedov, 2018/01/18
- [Qemu-devel] [PATCH v7 8/9] qcow2: skip writing zero buffers to empty COW areas, Anton Nefedov, 2018/01/18