On 24/05/2016 16:07, Peter Lieven wrote:
>
> Oh, thanks, and the if block also too complicated. If I am right it should
> collapse to:
>
> if (bytes < align) {
> qemu_iovec_add(&local_qiov, head_buf + bytes,
>align - bytes);
> bytes =
Am 2.05.2016 um 16:07 hat Peter Lieven geschrieben:
> Am 24.05.2016 um 15:59 schrieb Paolo Bonzini:
> >
> >On 24/05/2016 15:39, Peter Lieven wrote:
> >> bytes += offset & (align - 1);
> >> offset = offset & ~(align - 1);
> >Because the low bits have been masked away from offset an
Am 24.05.2016 um 15:59 schrieb Paolo Bonzini:
On 24/05/2016 15:39, Peter Lieven wrote:
bytes += offset & (align - 1);
offset = offset & ~(align - 1);
Because the low bits have been masked away from offset and added to bytes,
+
+/* if head and tail fall into the sa
On 24/05/2016 15:39, Peter Lieven wrote:
> bytes += offset & (align - 1);
> offset = offset & ~(align - 1);
Because the low bits have been masked away from offset and added to bytes,
> +
> +/* if head and tail fall into the same alignment
> + * we can omit the
in a read-modify-write cycle a small request might cause
head and tail to fall into the same alignment. Currently
QEMU reads the same block twice in this case which is
not necessary.
Signed-off-by: Peter Lieven
---
block/io.c | 12
1 file changed, 12 insertions(+)
diff --git a/bloc