[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2] block: Reject misaligned write requests with BDRV_REQ_NO_
From: |
Kevin Wolf |
Subject: |
Re: [PATCH v2] block: Reject misaligned write requests with BDRV_REQ_NO_FALLBACK |
Date: |
Mon, 14 Oct 2019 16:21:27 +0200 |
User-agent: |
Mutt/1.12.1 (2019-06-15) |
Am 14.10.2019 um 13:22 hat Alberto Garcia geschrieben:
> On Mon 14 Oct 2019 11:26:01 AM CEST, Kevin Wolf wrote:
> >> Signed-off-by: Alberto Garcia <address@hidden>
> >
> > Thanks, applied to the block branch.
>
> I'm a bit late now, but a possible trivial optimization is to flip the
> conditions, because checking the flag should be faster than checking the
> alignment and it's going to be false in almost all cases:
>
> if ((flags & BDRV_REQ_NO_FALLBACK) &&
> !QEMU_IS_ALIGNED(offset | bytes, align)) {
> return -ENOTSUP;
> }
>
> Feel free to edit the commit if you want.
Ok, I'll update it.
Kevin